-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix exception in code snippet, add check to CI (#532)
- Loading branch information
1 parent
a5276cd
commit a98ef54
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
mkdocs: | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache multiple paths | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
$RUNNER_TOOL_CACHE/Python/* | ||
~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-build-${{ matrix.python-version }} | ||
- name: install-reqs | ||
run: python -m pip install --upgrade tox virtualenv setuptools pip -r requirements-dev.txt | ||
- name: install-docs-reqs | ||
run: python -m pip install --upgrade -r docs/requirements-docs.txt | ||
- name: local-install | ||
run: python -m pip install -e . | ||
- name: check-no-errors | ||
run: python -m mkdocs build > output.txt 2>&1 | ||
- name: assert-no-errors | ||
run: python utils/check_for_no_build_errors.py | ||
- name: strict-docs-build | ||
run: mkdocs build --strict |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Check that `output.txt` doesn't contain the string | ||
"exited with errors". If it does, exit with status 1. | ||
This is just used in CI. | ||
""" | ||
|
||
import sys | ||
|
||
with open("output.txt") as fd: | ||
content = fd.read() | ||
|
||
if "exited with errors" in content: | ||
sys.exit(1) | ||
sys.exit(0) |