Versioning update #21
Workflow file for this run
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: Test Docs | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: '**/pyproject.toml' | |
- name: Install webdriver | |
run: sudo apt-get update && sudo apt-get install chromium-chromedriver | |
- name: Install dependencies | |
run: | | |
python${{ matrix.python-version }} -m pip install --upgrade pip packaging wheel | |
python${{ matrix.python-version }} -m pip install `grep numpy== requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt` | |
python${{ matrix.python-version }} -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt | |
python${{ matrix.python-version }} -m pip install --upgrade pip | |
python${{ matrix.python-version }} -m pip install --no-deps . | |
- name: Build new docs | |
run: | | |
cd docs_rst | |
make html | |
- name: Detect changes | |
if: contains(github.ref, 'refs/heads/main') | |
id: changes | |
shell: bash | |
run: | | |
echo "count=$(git diff-index HEAD | wc -l | xargs)" >> $GITHUB_OUTPUT | |
echo "files=$(git ls-files --exclude-standard --others | wc -l | xargs)" >> $GITHUB_OUTPUT | |
- name: Commit new docs | |
if: steps.changes.outputs.count > 0 || steps.changes.outputs.files > 0 | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add -A | |
git commit -m "Automated doc build" | |
git push | |
- name: pytest | |
if: contains(github.ref, 'refs/heads/main') | |
env: | |
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
run: pytest --color=yes --webdriver Firefox --headless crystal_toolkit/apps/examples/tests/ |