Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull from template #34

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
55b7e8d
remove supported apps page
CallumWalley Sep 19, 2024
27acdef
Add pymarkdown extensions to requirements
CallumWalley Sep 20, 2024
127821e
remove pymdown-extensions
CallumWalley Sep 20, 2024
eed4c37
consolidated and simplified somew stylesheets
CallumWalley Sep 23, 2024
3b89aa7
add prose and spellcheck config
CallumWalley Sep 23, 2024
4cc6884
Some improvements to problem matcher, added test fail file.
CallumWalley Sep 25, 2024
328a2a5
added extra catch to meta check
CallumWalley Sep 25, 2024
14090d8
Merge pull request #1 from nesi/advisory-heron
CallumWalley Sep 25, 2024
5a0046a
Remove fetch includes as that only really needed in support docs.
CallumWalley Sep 27, 2024
59202d2
Updated some stuff around dictionary updating
CallumWalley Sep 27, 2024
4a0596d
Demo deploy should work now
CallumWalley Sep 27, 2024
73a00da
Merge pull request #2 from nesi/advisory-heron
CallumWalley Sep 27, 2024
afa5c1d
Test PR
CallumWalley Sep 27, 2024
2129b9f
Update demo_deploy.yml
CallumWalley Sep 27, 2024
f6ecd01
trigger
CallumWalley Sep 27, 2024
13e81af
Update demo_deploy.yml
CallumWalley Sep 27, 2024
ecb4738
Update demo_deploy.yml
CallumWalley Sep 27, 2024
9ae6502
Merge branch 'main' into CallumWalley-patch-1
CallumWalley Sep 27, 2024
3599831
Oops no payload
CallumWalley Sep 27, 2024
0dad978
Merge pull request #4 from nesi/mergymere
CallumWalley Sep 27, 2024
7cb15e4
Merge pull request #3 from nesi/CallumWalley-patch-1
CallumWalley Sep 27, 2024
3a49693
Delete TODO.md
CallumWalley Sep 27, 2024
aaa3b7c
Update demo_deploy.yml
CallumWalley Sep 27, 2024
69bb22e
Delete SETUP.md
CallumWalley Sep 27, 2024
0677479
Update demo_deploy.yml
CallumWalley Sep 27, 2024
e51da16
Update README.md
CallumWalley Sep 27, 2024
727e9ef
Return to working
CallumWalley Sep 27, 2024
442c189
Delete overrides/partials/.gitkeep
CallumWalley Sep 27, 2024
0a37d78
Merge pull request #5 from nesi/no-todo
CallumWalley Sep 27, 2024
d78895b
remove comments
CallumWalley Sep 27, 2024
984a942
Fix commented out catch block
CallumWalley Sep 27, 2024
bf73d1c
Merge pull request #6 from nesi/advisory-heron
CallumWalley Sep 27, 2024
4dd58ab
Update from upstream again
CallumWalley Sep 27, 2024
b0452b4
Uneeded change
CallumWalley Sep 27, 2024
181e7bb
remove debug line
CallumWalley Sep 27, 2024
86e78b9
Merge remote-tracking branch 'template/main' into pull-from-template
CallumWalley Sep 27, 2024
10b5a06
uneeded change
CallumWalley Sep 27, 2024
3e13620
Updated checks and CI
CallumWalley Feb 16, 2025
e019af4
update vsocde stuff
CallumWalley Feb 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,35 @@

Description of current CI workflow.

## [fetch_includes.yml](fetch_includes.yml)

Retrieves dynamically generated content from external sources.

Currently retrieves:

- Software module list from [modules-list](https://github.com/nesi/modules-list).
- Glossary, spellcheck dictionary and snippets from [nesi-wordlist](https://github.com/nesi/nesi-wordlist)

It then runs [link_apps_pages.py](#link_apps_pagespy).

All modified files are added to a new branch called `new-assets` and merged into main.

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.

## [link_apps_pages.py](link_apps_pages.py)

A Python script used to add a link to the appropriate documentation to [modules-list.json](../../docs/assets/module-list.json).

The script checks all titles of input files, and sets the `support` key to be equal to the pages url.
It also adds whatever tags are on that page to the `domains` key.

_One day I would like to simplify this whole thing._

## [checks.yml](checks.yml)

A series of QA checks run on the documentation.

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

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

Runs on push to _main_ branch. Builds and deploys pages.

## [depo_deploy.yml](demo_deploy.yml)

## [auto_merge.yml](auto_marge.yml)
4 changes: 2 additions & 2 deletions .github/workflows/auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ env:
LABEL_NAME: auto_merge
jobs:
automerge:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
for branch in $(gh pr list -R ${TARGET_REPO} --label "${LABEL_NAME}" --json headRefName --jq .[].headRefName);do
git checkout $branch
git checkout ${branch}
gh pr merge --squash --auto --delete-branch
done

34 changes: 28 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
on:
push:
branches-ignore: [main]
repository_dispatch:
workflow_dispatch:
inputs:
fileList:
Expand All @@ -27,14 +28,18 @@ on:
description: Check Meta
default: true
type: boolean
checkSlurm:
description: Check Slurm
default: true
type: boolean
testBuild:
description: Test Build
default: true
type: boolean
jobs:
get:
name: Determine what files to check
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -58,7 +63,7 @@ jobs:
spellcheck:
name: Check Spelling
if: ${{ github.event_name != 'workflow_dispatch' || inputs.checkSpelling }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
Expand All @@ -80,7 +85,7 @@ jobs:
proselint:
name: Check Prose
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkProse}}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
Expand All @@ -100,7 +105,7 @@ jobs:
mdlint:
name: Check Markdown
if: ${{github.event_name != 'workflow_dispatch' || inputs.checkMarkdown}}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get
steps:
- if: ${{! needs.get.outputs.filelist}}
Expand All @@ -120,7 +125,7 @@ jobs:
metacheck:
name: Check page meta
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkMeta}}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get
steps:
- if: ${{ ! needs.get.outputs.filelist}}
Expand All @@ -134,10 +139,27 @@ jobs:
run: |
shopt -s globstar extglob
python3 checks/run_meta_check.py ${{needs.get.outputs.filelist}}
slurmcheck:
name: Check slurm scripts
if: ${{github.event_name != 'workflow_dispatch'|| inputs.checkSlurm}}
runs-on: ubuntu-22.04
needs: get
steps:
- if: ${{ ! needs.get.outputs.filelist}}
name: No files to check meta on.
run: exit 0
- if: ${{needs.get.outputs.filelist}}
name: Check out repo.
uses: actions/checkout@v4
- if: ${{needs.get.outputs.filelist}}
name: Check markdown meta.
run: |
shopt -s globstar extglob
python3 checks/run_slurm_lint.py ${{needs.get.outputs.filelist}}
testBuild:
name: Test build
if: ${{github.event_name != 'workflow_dispatch' || inputs.testBuild}}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: get
steps:
- uses: actions/checkout@v4
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/demo_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy PR branches
on:
pull_request:
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_REPO: "mkdocs-demo-deploy"
TARGET_OWNER: "CallumWalley"
WORKFLOW_ID: "deploy.yml"
DEPLOY_URL: "https://callumwalley.github.io/mkdocs-demo-deploy"
HEAD: ${{ github.event.pull_request.head.ref }}
permissions: write-all
jobs:
demo-deploy:
continue-on-error: true
name: Trigger test deployments
runs-on: ubuntu-22.04
steps:
- name: Trigger Workflow in Another Repository
run: |
set -x
set -o xtrace
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches \
-d "{\"event_type\":\"deploy\",\"client_payload\":{\"targets\":\"${GITHUB_REPOSITORY}:${HEAD}\", \"use-cache\":\"true\"}}"

# This would be better if it worked
# - name: Run 'deploy.yml' Workflow
# uses: convictional/[email protected]
# with:
# owner: ${TARGET_OWNER}
# repo: ${TARGET_REPO}
# github_token: ${{ secrets.PAT }}
# workflow_file_name: deploy.yml
# client_payload: '{"targets":"${GITHUB_REPOSITORY}:${HEAD}", "use-cache":"true"}'
- name: Wait for Workflow Action
run: |
# Just give a minute or so to deploy
sleep 60
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Post messages open requests
run: |
msg="Test deployment available at <a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}\">${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}</a>"
changed_pages="$(git diff --name-only origin/main -- '*.md')"
# Logic for truncating out long sections commented out.
# maxlines=-5
if [ -n "${changed_pages}" ]; then
msg="${msg}<br><br>Seems the following pages differ;<br><ul>"
for f in ${changed_pages};do
# maxlines=((maxlines+1))
#if [ ${maxlines} -lt 1 ]; then
g=${f#*/}; h=${g%.*}
msg="${msg}<li><a href=\"${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}/${h}\" target=_blank>${h##*/}</a></li>"
#fi
done
# if [ ${maxlines} -gt 0 ];then
# msg="${msg}<li> ... and ${maxlines} more.</li>"
# fi
msg="${msg}</ul>"
fi
msg="${msg}<br><br><em><a href="${DEPLOY_URL}">See all deployed demo sites</a></em>"
(gh pr comment ${HEAD} --edit-last --body "${msg}") || (gh pr comment ${HEAD} --body "${msg}")
echo "::info title=Deploy successful::${DEPLOY_URL}/${GITHUB_REPOSITORY}/${HEAD}"
19 changes: 4 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Deploy to gh-pages
on:
push:
push:
branches: [main]
workflow_dispatch:
# inputs:
# pr-deploy:
# description: Deploy open merge requests in sub-directories.
# type: boolean
# default: true
workflow_dispatch:
env:
PYTHON_VERSION: 3.x
GH_TOKEN: ${{ github.token }}
Expand All @@ -19,7 +14,7 @@ permissions:
jobs:
documentation:
name: Build documentation
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -28,6 +23,7 @@ jobs:
sparse-checkout: |
docs
overrides
.github
- name: Set up Python runtime
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -62,10 +58,3 @@ jobs:
with:
key: mkdocs-${{ hashfiles('.cache/**') }}
path: .cache
# - name: Post messages to PRs
# run: |
# for pr in ${{ steps.dev-deps.outputs.branches }}; do
# msg="Test deployment available at <a href=\"https://docs.nesi.org.nz/${pr}\">https://docs.nesi.org.nz/${pr}</a>"
# (gh pr comment ${pr} --edit-last --body "${msg}") || (gh pr comment ${pr} --body "${msg}")
# done

10 changes: 7 additions & 3 deletions .vscode/includes.code-snippets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// Place your agdr-docs workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// Place your support-docs workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
Expand Down Expand Up @@ -85,7 +85,9 @@
"created_at: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
// "title: ${1:${TM_FILENAME/_/ /g}}}",
"description: ${1}",
"tags: [${2}]",
"tags: ",
" - ${2}",
" - ${3}",
"---",
"",
"${0}"
Expand All @@ -98,7 +100,9 @@
"---",
"created_at: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
"description: ${1:Will be used to generate page preview. Should not contain keywords not in the body of article.}",
"tags: [${2:tag1},${3:tag2}]",
"tags:",
" - ${2:tag1}",
" - ${3:tag2}",
"---",
"",
"${4:Short preface to article.}",
Expand Down
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Proselint",
"type": "debugpy",
"request": "launch",
"program": "checks/run_proselint.py",
"args": ["docs/fail_checks.md"],
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Debug Meta Check",
"type": "debugpy",
"request": "launch",
"program": "checks/run_meta_check.py",
"args": ["docs/fail_checks.md"],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Debug Testbuild",
"type": "debugpy",
"request": "launch",
"program": "checks/run_test_build.py",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Debug Slurm Lint",
"type": "debugpy",
"request": "launch",
"program": "checks/run_slurm_lint.py",
"args": ["docs/Scientific_Computing/Supported_Applications/ABAQUS.md"],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
19 changes: 15 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@
"triggerTaskOnSave.on": true,
"triggerTaskOnSave.tasks": {
"meta-checks": [
"docs/**/*.md"
"docs/**/*.md",
"checks/fail_checks.md"
],
"proselint-checks": [
"docs/**/*.md"
"docs/**/*.md",
"checks/fail_checks.md"
],
"spelling-checks": [
"docs/**/*.md"
"docs/**/*.md",
"checks/fail_checks.md"
],
"slurm-lint": [
"docs/**/*.md",
"checks/fail_checks.md"
],
"test-build": [
"docs/**/*.md"
"docs/**/*.md",
"checks/fail_checks.md"
]
},
"files.autoSave": "afterDelay",
Expand Down Expand Up @@ -40,6 +48,9 @@
"redhat.telemetry.enabled": false,
"githubPullRequests.pushBranch": "always",
"git.useEditorAsCommitInput": false,
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///workspaces/support-docs/.github/workflows/deploy.yml"
},
"markdown.copyFiles.destination": {
"docs/**/*": "/docs/assets/images/"
},
Expand Down
Loading
Loading