Fix docs pipeline, make docs tests easier to run locally and on different OSes (#1554)

* update docs pipeline to use poe task runner

* move npm dependency into package.json file instead of hardcoding into pipeline

* replace nix-specific call with python version (for windows compat)

* update commands to use python for win compat

* update lock file

* change deps to take out xq and use xmltodict instead

* move script tasks from pyproject into new tasks.py

* run linting on new tasks.py file

* fix typo

* clean up pyproject to make valid toml

* update docs with correct task runner command

* use npx in case node_modules/.bin isn't in the path

* Run pa11y-ci in cross-platform manner (works on Windows)

* Add node_modules to .gitignore

* clean up poe alias

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
Jonathan Wren 2022-08-21 13:47:25 -07:00 committed by GitHub
parent 33607acbb6
commit 671f403602
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 2397 additions and 300 deletions

View file

@ -62,26 +62,11 @@ jobs:
pip install poetry
poetry config --local virtualenvs.in-project true
poetry install --no-root --remove-untracked
npm install pa11y-ci
npm install
echo "node_modules/.bin" >> $GITHUB_PATH
- name: Start docs server
run: poetry run poe docs &
- name: Generate sitemap
env:
site_url: http://127.0.0.1:8000
run: |
filename='sitemap.xml'
select="{urls: [\"${site_url}/\", \"${site_url}/search.html?q=jrnl\", .urlset.url[].loc]}"
curl -s "${site_url}/${filename}" > $filename
echo "::group::${filename}"
cat $filename
echo '::endgroup::'
poetry run xq "$select" $filename > list.json
run: poetry run poe docs-run &
- name: Accessibility testing (Pa11y)
run: pa11y-ci -c list.json
run: poetry run poe docs-check