Coverage report and Codecov.io upload #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: API Documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'docs/**' | |
- '.github/workflows/docs.yml' | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'docs/**' | |
- '.github/workflows/docs.yml' | |
jobs: | |
apidocs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out smax-python | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install numpy libs | |
run: pip install numpy | |
- name: Install psutil libs | |
run: pip install psutil | |
- name: Install redis libs | |
run: pip install redis | |
- name: Install Sphinx and RTM theme | |
run: pip install sphinx sphinx-rtd-theme | |
- name: Build docs | |
run: | | |
cd docs | |
sphinx-apidoc -o . ../src/smax | |
sphinx-build -M html . . | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: 'gh-pages' | |
path: site | |
- name: copy docs to gh-pages | |
run: cp -a docs/html/* site/ | |
- name: Push to pages | |
run: | | |
cd site | |
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
git add -A | |
git commit -m "[automated site update]" && git push || true |