Skip to content

CI

CI #570

Workflow file for this run

name: CI
on:
pull_request:
push:
schedule:
- cron: '0 0/2 * * *'
jobs:
build:
if: endsWith(github.head_ref || github.ref_name, '.changes') == false
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
fail-fast: false
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tools
run: |
sudo apt -y install libxml2-utils
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test/unit/requirements.txt
pip install .
- name: Build Test
run: |
cd test/must-build && make html SPHINXOPTS='-W'
- name: Build Test with toc show_parents=hide
run: |
cd test/must-build && make html SPHINXOPTS='-W -D toc_object_entries_show_parents=hide'
- name: Build Test with toc show_parents=domain
run: |
cd test/must-build && make html SPHINXOPTS='-W -D toc_object_entries_show_parents=domain'
- name: Build Test with toc show_parents=all
run: |
cd test/must-build && make html SPHINXOPTS='-W -D toc_object_entries_show_parents=all'
- name: Run Unit Testing
run: |
cd test/unit
find . -name '*.html' -exec rm {} \;
make html SPHINXOPTS='-W'
(cd _build/html && find . -name '*.html' -exec sh -c 'xmllint {} --xpath '"'"'//div[@role="main"]'"'"' | xmllint --format - > ../../{}' \;)
rm genindex.html index.html search.html php-modindex.html
- name: Diff Unit Outputs
run: |
cd test/unit
rm -r _build
git add . -N && git diff --exit-code
- name: Push Unit Changes
if: failure()
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.head_ref || github.ref_name }}.changes
push_options: '--force'
commit_message: Unit Changes
commit_user_name: Bot
commit_user_email: [email protected]
commit_author: Bot <[email protected]>