From f39c54be8d6891e09a3d4179f14c4b7031cb888c Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 5 Nov 2021 20:28:25 +1100 Subject: [PATCH 1/4] 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 From ce3ec5a88873e450627f54c9fed2bc7078f05d0a Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 5 Nov 2021 20:33:16 +1100 Subject: [PATCH 2/4] Actually run the workflow --- .github/workflows/check_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_config.yaml b/.github/workflows/check_config.yaml index 77ea5c2..254dbc9 100644 --- a/.github/workflows/check_config.yaml +++ b/.github/workflows/check_config.yaml @@ -23,4 +23,4 @@ jobs: python-version: 3.7 - name: Run Checks run: | - \ No newline at end of file + python ci/check_mkdocs_config.py From 11c9aadd1b0c0eebd08ce5c5fe75b65381507811 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 5 Nov 2021 20:36:44 +1100 Subject: [PATCH 3/4] install yaml --- .github/workflows/check_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_config.yaml b/.github/workflows/check_config.yaml index 254dbc9..3acb17a 100644 --- a/.github/workflows/check_config.yaml +++ b/.github/workflows/check_config.yaml @@ -23,4 +23,5 @@ jobs: python-version: 3.7 - name: Run Checks run: | + pip install yaml python ci/check_mkdocs_config.py From f5b421251e8baddc9e7c528cba4395691a8c9d01 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 5 Nov 2021 20:39:39 +1100 Subject: [PATCH 4/4] wrong package name --- .github/workflows/check_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_config.yaml b/.github/workflows/check_config.yaml index 3acb17a..6081b97 100644 --- a/.github/workflows/check_config.yaml +++ b/.github/workflows/check_config.yaml @@ -23,5 +23,5 @@ jobs: python-version: 3.7 - name: Run Checks run: | - pip install yaml + pip install pyyaml python ci/check_mkdocs_config.py