Skip to content

Update check-docs.yml #37

Update check-docs.yml

Update check-docs.yml #37

Workflow file for this run

name: CD
on:
push:
branches:
- master
- main
jobs:
coverage:
name: Deploy Coverage Results
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Check Python Version
run: python --version
- name: Install Package Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r develop.txt
- name: Install PySAP
run: python -m pip install .
- name: Run Tests
run: python -m pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests
api:
name: Deploy API Documentation
needs: coverage
runs-on: ubuntu-latest
if: success()
env:
gh_root: https://github.com/CEA-COSMIC/
tag_path: /archive/refs/tags/
sphinx_opts: -t docs/_templates -feTMo docs/source
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Check Python Version
run: python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pandoc
python -m pip install -r docs/requirements.txt
python -m pip install .
- name: Download plug-ins
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
plugin_version="$(echo ${_plugin} | awk -F== '{print $2}')"
wget ${gh_root}${plugin_name}${tag_path}${plugin_version}.tar.gz -O ${plugin_name}.tar.gz
done < plugins.txt
for file in *.tar.gz; do
tar xzf "$file"
python -m pip install ${plugin_name}-*/.
done
rm *.tar.gz
- name: Extract plug-in examples
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
cp -r ${plugin_name}-*/examples examples/${plugin_name} || echo "Warning: no examples found for ${plugin_name}"
done < plugins.txt
- name: Build PySAP source files
run: sphinx-apidoc ${sphinx_opts} pysap
- name: Build plug-in source files
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
package_name="$(echo ${plugin_name} | awk -F- '{print $2}')"
sphinx-apidoc ${sphinx_opts} ${plugin_name}-*/${package_name}
done < plugins.txt
- name: Build API documentation
run: sphinx-build -E docs/source docs/_build
- name: Deploy API documentation
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build