Skip to content

Add doc workflow GH

Add doc workflow GH #1

Workflow file for this run

name: Documentation Tests
on: [push, pull_request]
jobs:
CheckDocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r doc/requirements.txt
- name: Check doc build
run: |
cd doc
make html SPHINXOPTS="-W"
cd ..
- name: Check doc coverage
run: |
cd doc
make coverage
cat build/coverage/python.txt
cat build/coverage/python.txt | wc -l | xargs -I % test % -eq 2
cd ..
- name: Check doc links
run: |
cd doc
make linkcheck
cd ..
Doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
bash ./.github/scripts/install_libiio.sh
bash ./.github/scripts/install_part_libs.sh
bash ./.github/scripts/install_pydeps.sh
pip install -r requirements_doc.txt
- name: Build doc
run: |
cd doc && make html
cd ..
DeployMainDoc:
runs-on: ubuntu-latest
needs: [Test,Lint,Doc]

Check failure on line 65 in .github/workflows/doc.yml

View workflow run for this annotation

GitHub Actions / Documentation Tests

Invalid workflow file

The workflow is not valid. .github/workflows/doc.yml (Line: 65, Col: 13): Job 'DeployMainDoc' depends on unknown job 'Test'. .github/workflows/doc.yml (Line: 65, Col: 18): Job 'DeployMainDoc' depends on unknown job 'Lint'.
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r doc/requirements.txt
- name: Build doc and release
run: |
cd doc && make html
cd ..
- name: Publish doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build/html
destination_dir: main
DeployDevelopmentDoc:
runs-on: ubuntu-latest
needs: [Test,Lint,Doc]
# Only run on pull requests to main and non-forks
if: github.event_name == 'pull_request' && github.base_ref == 'main' && ! github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r doc/requirements.txt
- name: Build doc and release
run: |
export GIT_BRANCH=${{ github.head_ref }}
export DEV_BUILD=1
cd doc && make html
cd ..
- name: Publish doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build/html
destination_dir: prs/${{ github.head_ref }}
- name: Add comment to PR
uses: mshick/add-pr-comment@v2
with:
message: |
Generated documentation for this PR is available at [Link](https://analogdevicesinc.github.io/pyadi-iio/prs/${{ github.head_ref }}/index.html)
Deploy:
runs-on: ubuntu-latest
needs: [Test,Lint,Doc]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r doc/requirements.txt
pip install setuptools wheel twine build
- name: Build doc and release
run: |
cd doc && make html
cd ..
python -m build
- name: Publish doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build/html
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}