From f39c54be8d6891e09a3d4179f14c4b7031cb888c Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 5 Nov 2021 20:28:25 +1100 Subject: [PATCH] Add a .github workflow to check that "strict" mode is always set --- .github/workflows/check_config.yaml | 26 ++++++++++++++++++++++++++ ci/check_mkdocs_config.py | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/check_config.yaml create mode 100644 ci/check_mkdocs_config.py diff --git a/.github/workflows/check_config.yaml b/.github/workflows/check_config.yaml new file mode 100644 index 0000000..77ea5c2 --- /dev/null +++ b/.github/workflows/check_config.yaml @@ -0,0 +1,26 @@ +name: Config Checks + +on: + push: + branches-ignore: + - l10* + + pull_request: + branches-ignore: + - l10* + +jobs: + + mkdocs: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Run Checks + run: | + \ No newline at end of file diff --git a/ci/check_mkdocs_config.py b/ci/check_mkdocs_config.py new file mode 100644 index 0000000..0e243d9 --- /dev/null +++ b/ci/check_mkdocs_config.py @@ -0,0 +1,13 @@ +import os +import yaml + +here = os.path.dirname(__file__) + +tld = os.path.abspath(os.path.join(here, '..')) + +config_file = os.path.join(tld, 'mkdocs.yml') + +with open(config_file, 'r') as f: + data = yaml.safe_load(f) + + assert data['strict'] == True \ No newline at end of file