From c20f2e08e2c235c7ded6d42da6035d9d8d270b28 Mon Sep 17 00:00:00 2001 From: Tania Allard Date: Tue, 2 Jul 2024 11:43:24 +0100 Subject: [PATCH] MAINT - Add CI env check for a11y tests (#1915) --- .github/workflows/CI.yml | 1 - tox.ini | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 877756193..c6c7f6058 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -106,7 +106,6 @@ jobs: - name: "Run accessibility tests with playwright 🎭" # build PST, build docs, then run a11y-tests run: python -Im tox run -e py312-docs,a11y-tests - continue-on-error: true # Build our docs (PST) on major OSes and check for warnings build-site: diff --git a/tox.ini b/tox.ini index e109a8113..b675d5a9a 100644 --- a/tox.ini +++ b/tox.ini @@ -72,15 +72,18 @@ commands = [testenv:a11y-tests] description = run accessibility tests with Playwright and axe-core base_python = py312 # keep in sync with tests.yml +pass_env = GITHUB_ACTIONS # so we can check if this is run on GitHub Actions extras = test a11y depends = compile, py312-docs -allowlist_externals=playwright +allowlist_externals= + playwright + bash commands = - playwright install + bash -c 'if [[ "{env:GITHUB_ACTIONS:}" == "true" ]]; then playwright install --with-deps; else playwright install; fi' pytest -m "a11y" {posargs} # build PST documentation with the default or a specific Sphinx version