Skip to content

Commit 3e13620

Browse files
committed
Updated checks and CI
1 parent 10b5a06 commit 3e13620

12 files changed

+406
-70
lines changed

.github/workflows/README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,35 @@
22

33
Description of current CI workflow.
44

5+
## [fetch_includes.yml](fetch_includes.yml)
6+
7+
Retrieves dynamically generated content from external sources.
8+
9+
Currently retrieves:
10+
11+
- Software module list from [modules-list](https://github.com/nesi/modules-list).
12+
- Glossary, spellcheck dictionary and snippets from [nesi-wordlist](https://github.com/nesi/nesi-wordlist)
13+
14+
It then runs [link_apps_pages.py](#link_apps_pagespy).
15+
16+
All modified files are added to a new branch called `new-assets` and merged into main.
17+
18+
In theory, all this could be done at deployment, but I wanted to make sure that changes to these remote files didn't break anything.
19+
20+
## [link_apps_pages.py](link_apps_pages.py)
21+
22+
A Python script used to add a link to the appropriate documentation to [modules-list.json](../../docs/assets/module-list.json).
23+
24+
The script checks all titles of input files, and sets the `support` key to be equal to the pages url.
25+
It also adds whatever tags are on that page to the `domains` key.
26+
27+
_One day I would like to simplify this whole thing._
28+
529
## [checks.yml](checks.yml)
630

731
A series of QA checks run on the documentation.
832

9-
The checks can be started manually from the ![workflow page](https://github.com/nesi/agdr-docs/actions/workflows/checks.yml/badge.svg),
33+
The checks can be started manually from the ![workflow page](https://github.com/nesi/support-docs/actions/workflows/checks.yml/badge.svg),
1034
select the target branch, give the pattern of files to include, and select which checks you want done.
1135

1236
Checks will also be run on any _non main_ branch pushes. All checks will be run, but only on _changed_ files.
@@ -16,7 +40,3 @@ More info on what these checks do in [README.md](../../checks/README.md)
1640
## [deploy.yml](deploy.yml)
1741

1842
Runs on push to _main_ branch. Builds and deploys pages.
19-
20-
## [depo_deploy.yml](demo_deploy.yml)
21-
22-
## [auto_merge.yml](auto_marge.yml)

.github/workflows/auto_merge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ env:
99
LABEL_NAME: auto_merge
1010
jobs:
1111
automerge:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717
- run: |
1818
for branch in $(gh pr list -R ${TARGET_REPO} --label "${LABEL_NAME}" --json headRefName --jq .[].headRefName);do
19-
git checkout $branch
19+
git checkout ${branch}
2020
gh pr merge --squash --auto --delete-branch
2121
done
2222

.github/workflows/checks.yml

+28-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ env:
44
on:
55
push:
66
branches-ignore: [main]
7+
repository_dispatch:
78
workflow_dispatch:
89
inputs:
910
fileList:
@@ -27,14 +28,18 @@ on:
2728
description: Check Meta
2829
default: true
2930
type: boolean
31+
checkSlurm:
32+
description: Check Slurm
33+
default: true
34+
type: boolean
3035
testBuild:
3136
description: Test Build
3237
default: true
3338
type: boolean
3439
jobs:
3540
get:
3641
name: Determine what files to check
37-
runs-on: ubuntu-latest
42+
runs-on: ubuntu-22.04
3843
steps:
3944
- name: Checkout Repo
4045
uses: actions/checkout@v4
@@ -58,7 +63,7 @@ jobs:
5863
spellcheck:
5964
name: Check Spelling
6065
if: ${{ github.event_name != 'workflow_dispatch' || inputs.checkSpelling }}
61-
runs-on: ubuntu-latest
66+
runs-on: ubuntu-22.04
6267
needs: get
6368
steps:
6469
- if: ${{! needs.get.outputs.filelist}}
@@ -80,7 +85,7 @@ jobs:
8085
proselint:
8186
name: Check Prose
8287
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkProse}}
83-
runs-on: ubuntu-latest
88+
runs-on: ubuntu-22.04
8489
needs: get
8590
steps:
8691
- if: ${{! needs.get.outputs.filelist}}
@@ -100,7 +105,7 @@ jobs:
100105
mdlint:
101106
name: Check Markdown
102107
if: ${{github.event_name != 'workflow_dispatch' || inputs.checkMarkdown}}
103-
runs-on: ubuntu-latest
108+
runs-on: ubuntu-22.04
104109
needs: get
105110
steps:
106111
- if: ${{! needs.get.outputs.filelist}}
@@ -120,7 +125,7 @@ jobs:
120125
metacheck:
121126
name: Check page meta
122127
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkMeta}}
123-
runs-on: ubuntu-latest
128+
runs-on: ubuntu-22.04
124129
needs: get
125130
steps:
126131
- if: ${{ ! needs.get.outputs.filelist}}
@@ -134,10 +139,27 @@ jobs:
134139
run: |
135140
shopt -s globstar extglob
136141
python3 checks/run_meta_check.py ${{needs.get.outputs.filelist}}
142+
slurmcheck:
143+
name: Check slurm scripts
144+
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkSlurm}}
145+
runs-on: ubuntu-22.04
146+
needs: get
147+
steps:
148+
- if: ${{ ! needs.get.outputs.filelist}}
149+
name: No files to check meta on.
150+
run: exit 0
151+
- if: ${{needs.get.outputs.filelist}}
152+
name: Check out repo.
153+
uses: actions/checkout@v4
154+
- if: ${{needs.get.outputs.filelist}}
155+
name: Check markdown meta.
156+
run: |
157+
shopt -s globstar extglob
158+
python3 checks/run_slurm_lint.py ${{needs.get.outputs.filelist}}
137159
testBuild:
138160
name: Test build
139161
if: ${{github.event_name != 'workflow_dispatch' || inputs.testBuild}}
140-
runs-on: ubuntu-latest
162+
runs-on: ubuntu-22.04
141163
needs: get
142164
steps:
143165
- uses: actions/checkout@v4

.github/workflows/demo_deploy.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
demo-deploy:
1515
continue-on-error: true
1616
name: Trigger test deployments
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Trigger Workflow in Another Repository
2020
run: |
@@ -37,14 +37,6 @@ jobs:
3737
# github_token: ${{ secrets.PAT }}
3838
# workflow_file_name: deploy.yml
3939
# client_payload: '{"targets":"${GITHUB_REPOSITORY}:${HEAD}", "use-cache":"true"}'
40-
- name: Wait for Workflow Action
41-
run: |
42-
curl -L \
43-
-X POST \
44-
-H "Accept: application/vnd.github+json" \
45-
-H "Authorization: Bearer ${{ secrets.PAT }}" \
46-
-H "X-GitHub-Api-Version: 2022-11-28" \
47-
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/actions/runs/deploy.yml
4840
- name: Wait for Workflow Action
4941
run: |
5042
# Just give a minute or so to deploy

.github/workflows/deploy.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Deploy to gh-pages
22
on:
3-
push:
3+
push:
44
branches: [main]
5-
workflow_dispatch:
5+
workflow_dispatch:
66
env:
77
PYTHON_VERSION: 3.x
88
GH_TOKEN: ${{ github.token }}
@@ -14,7 +14,7 @@ permissions:
1414
jobs:
1515
documentation:
1616
name: Build documentation
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
steps:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
@@ -23,6 +23,7 @@ jobs:
2323
sparse-checkout: |
2424
docs
2525
overrides
26+
.github
2627
- name: Set up Python runtime
2728
uses: actions/setup-python@v5
2829
with:

checks/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ Spellcheck pipeline settings can be modified in [.spellcheck.yml](../.spellcheck
1616
List of custom words can be found in [dictionary.txt](../docs/assets/glossary/dictionary.txt),
1717
however you **should not edit this manually**, see [adding-words-to-dictionary](../docs/CONTRIBUTING.md#adding-words-to-dictionary).
1818

19-
This list is automatically updated daily in the case of docs.nesi, but not the other sites.
20-
You should occasionally run
21-
`wget -O docs/assets/glossary/dictionary.txt https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt`
22-
to keep it up to date.
23-
24-
2519
### Limitations
2620

2721
Spellchecker does not provide output lineumber / column.

checks/fail_checks.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
created_at: 2025-01-28
3+
template: not_a_template
4+
---
5+
6+
7+
8+
This page is meant for testing the linting checks. For all checks to run properly this file should be moved under `docs`.
9+
10+
It should trigger the fail threshold for `meta-checks`, `proselint-checks`, `spelling-checks`, `slurm-lint`, and `test-build`
11+
12+
Add tests here as needed.
13+
14+
Somee tpyos for spelchecker to triger fail neeeds to be at laest fiveteen keybored whopsers whiche is qiute a hihe tolerence i thinc. I woold loweir this threshehold bute for the momenent it can be a bitte overzaelos.
15+
16+
``` as
17+
typos shuold be igonred in code blokcs
18+
```
19+
20+
!!! warning "some admonistion"
21+
contents of admonition
22+
23+
Typos should `be igonred` in inline code blocks.
24+
25+
Typos should [be ignored](https://www.docs.nesi.org.nz)
26+
Typos should [be ignored](../docs/General/FAQs/How_do_I_request_memory.md)
27+
28+
29+
30+
Bad formatting for markdownlint
31+
32+
* bullet points
33+
- bullet points
34+
35+
### Improper
36+
37+
## Header nesting
38+
39+
40+
```sl
41+
!#/bin/bash
42+
43+
44+
#SBATCH -j short-option
45+
#SBATCH --not-a-real-flag=not_real
46+
47+
module load something
48+
49+
```
50+
51+
[bad link](../docs/General/not-a-page.md)
52+
53+
[bad internal link](#impropers)
54+
55+
Very very bad prose shit this is probably very unproper language sorry about that hopefully the chairman doesn't see lets circle back around.
56+
57+
The following checks will only work if moved into a subdir of `docs/`
58+
59+
https://www.nesi.org.nz/deadlink
60+
61+
62+
{{broken_macro()}}
63+
64+
{% include "not-real.md" -%}
65+
66+
67+
{{broken_macro()}}
68+
69+
70+
{% set app_name = page.no_a_variable | trim %}

0 commit comments

Comments
 (0)