name the test workflow #384
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: pytest nbconvert-a11y, axe test exports, build docs. | |
on: | |
- push | |
jobs: | |
pypi: | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
matrix: | |
python-version: | |
- "3.10" | |
runs-on: ubuntu-latest | |
steps: | |
- name: fetch all history and tags | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('test-environment.yml') }} | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: test-environment.yml | |
cache-environment: true | |
- name: init playwright nbconvert-a11y | |
run: | | |
playwright install --with-deps chromium | |
npm install vnu-jar axe-core | |
pip install -e. | |
doit copy | |
- name: test with pytest | |
run: | | |
# the smoke generate html assets that are used in the accessibility testing. | |
# we run this script to generate assets and test the nbconvert-a11y module. | |
pytest tests/test_smoke.py | |
pytest --deselect tests/test_smoke.py | |
- name: mkdocs | |
run: | | |
mkdocs build -v | |
- name: Deploy main 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: ${{ github.ref_name == 'main' }} | |
with: | |
folder: site # The folder the action should deploy. | |
single-commit: true | |
- name: Deploy non-main 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: ${{ github.ref_name != 'main' }} | |
with: | |
folder: site # The folder the action should deploy. | |
single-commit: true | |
target-folder: branch/${{ github.ref_name }} | |