Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Oct 11, 2024
1 parent f5af330 commit 57e9295
Show file tree
Hide file tree
Showing 10 changed files with 393 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/check_links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Check that all links are valid, i.e. not broken
name: Check links

# Check links on the 21st day of the month.
# 21st as the first letter of this repo is the 21st letter in the alphabet.
on:
push:
pull_request:
schedule:
- cron: "0 0 21 * *"


jobs:
check-links:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

# The link checker will only work if mlc_config.json is a valid JSON
- name: Validate JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: .github/workflows/valid_json_schema.json
INPUT_JSONS: mlc_config.json

# These are status code that cannot be ignored.
#
# If there is a valid external link that fails,
# add it to mlc_config.json
- name: External links must be checked, do not allow '0' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]0[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi

- name: Internal links must checked, do not allow '400' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]400[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi


# For an indented block, a link to a broken image is ignored, as the link checker assumes it to be code.
# In our case, it is not: for us, it is usually an admonition (i.e. a 'question' or 'info' block)
# Here all indented text is unindented
# https://github.com/UPPMAX/UPPMAX-documentation/issues/114
- name: unindent text
run: ./scripts/unindent_text.sh

- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: 'mlc_config.json'
use-quiet-mode: 'yes'
use-verbose-mode: 'no'

44 changes: 44 additions & 0 deletions .github/workflows/check_markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Check that there is correct markdown in all files
name: Check markdown

# Check spelling on the 21st day of the month.
# 21st as the first letter of this repo is the 21st letter in the alphabet.
on:
push:
pull_request:
schedule:
- cron: "0 0 21 * *"

jobs:
check_markdown:

runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:

- name: Set up Git repository
uses: actions/checkout@v4

# Indented blocks are ignored, as the linter assumes it to be code.
# In our case, it is not: for us, it is usually an admonition (i.e. a 'question' or 'info' block)
# Here all indented text is unindented
# https://github.com/UPPMAX/UPPMAX-documentation/issues/114
- name: unindent text
run: ./scripts/unindent_text.sh

- uses: articulate/actions-markdownlint@v1
with:
config: .markdownlint.jsonc
ignore: .markdownlintignore

# There are many linters with the same name,
# this is the linter whose documentation to look into :-)
- name: CLI to the linter is at https://github.com/igorshubovych/markdownlint-cli
run: echo "CLI to the linter is at https://github.com/igorshubovych/markdownlint-cli"

# There are many linters with the same name,
# this is the linter whose documentation to look into :-)
- name: Linter is at https://github.com/DavidAnson/markdownlint
run: echo "Linter is at https://github.com/DavidAnson/markdownlint"

30 changes: 30 additions & 0 deletions .github/workflows/check_spelling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Check that there is correct spelling in all files
name: Check spelling

# Check spelling on the 21st day of the month.
# 21st as the first letter of this repo is the 21st letter in the alphabet.
on:
push:
pull_request:
schedule:
- cron: "0 0 21 * *"


jobs:
check_spelling:

runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:

- name: Set up Git repository
uses: actions/checkout@v4

- name: Do not check raw evaluation results
run: rm evaluations/20240827/survey_feedback.md

- uses: igsekor/[email protected]



6 changes: 6 additions & 0 deletions .github/workflows/valid_json_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"properties": {
"foo": { "type": "string" },
"bar": { "type": "number" }
}
}
43 changes: 43 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Example markdownlint configuration with all properties set to their default value
{

// Default state for all rules
"default": true,

// MkDocs assumes 4 spaces for indentation.
// Markdown assumes 4 spaces for indentation.
// That markdownlint has a different default is the error of markdownlint
"MD007": { "indent": 4 },

// Standard markdown does not allow for two correct consecutive blank lines
// i an admonitions (a.o. the 'question' admonition):
//
// ???- question "A question"
//
// ```
// echo "indented code here :-)
// ````
// [blank line 1 here]
// [blank line 2 here]
//
// Hence we allow 2 consecutive blank lines
//
"MD012": {
// Consecutive blank lines, CHANGED FROM 1
"maximum": 2
},

// Standard markdown does not allow for valid indent code like this:
//
// ???- question "A question"
//
// ```
// echo "indented code here :-)
// ````
//
// Hence we allow valid indented code.
//
// MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md
"MD046": false

}
3 changes: 3 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs/index.md
docs/software/software-table.md
evaluations/**/*_feedback.md
45 changes: 45 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
matrix:
- name: markdown
dictionary:
wordlists:
- .wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: true
attributes:
- alt
ignores:
- ':matches(code, pre)'
- 'code'
- 'pre'
- 'blockquote'
sources:
- '**/*.md'
default_encoding: utf-8
- name: Quarto markdown
dictionary:
wordlists:
- .wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: true
attributes:
- alt
ignores:
- ':matches(code, pre)'
- 'code'
- 'pre'
- 'blockquote'
sources:
- '**/*.md'
default_encoding: utf-8
124 changes: 124 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
Richel
Richèl
UPPMAX
config
Dardel
github
html
https
json
jsonc
linter
markdownlint
markdownlintignore
mlc
Servicedesk
txt
uppmax
Uppsala
UU
wordlist
yml
Awk
bianca
bilderbeek
Bioinformatics
BSc
CentOS
Centre
clustername
Codecademy
CodeRefinery
Conda
CPUs
dataset
emacs
ENCCS
EuroCC
faq
FileZilla
formalisms
GDPR
gedit
genomic
GPUs
gvim
HPC
icm
MSc
NAISS
naiss
nano
NGI
personuppgifter
Rackham
RedHat
richel
scp
se
sexualized
Skydd
Slurm
SNIC
snic
socio
Sunet
SUNET
SUPR
supr
Swegen
ThinLinc
Transfering
uu
VPN
www
Bourne
cd
chmod
Crex
Deamons
docx
Domus
Lutra
MacOS
Miarka
Nvidia
rackham
Richèl's
subdirectories
tmp
Vulpes
connectivist
cowsay
distros
Easybuild
et
filesystem
hdd
linuxjourney
macbook
marcusl
multiuser
Nextflow
pre
Rackham's
reproducibility
RStudio
Spack
tcsh
Thunar
VSCode
VSCodium
webbrowser
wikipedia
IDEs
slurm
bioinformaticians
filezilla
ide
mins





13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,15 @@ You can share your feedback at this repository by:
- `[Deenadayalan et al., 2008]`
Deenadayalan, Yamini, et al.
"How to run an effective journal club: a systematic review."
Journal of evaluation in clinical practice 14.5 (2008): 898-911.
Journal of evaluation in clinical practice 14.5 (2008): 898-911.

## Files used by continuous integration scripts

Filename |Descriptions
--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------
[mlc_config.json](mlc_config.json) |Configuration of the link checker, use `markdown-link-check --config mlc_config.json --quiet docs/**/*.md` to do link checking locally
[.spellcheck.yml](.spellcheck.yml) |Configuration of the spell checker, use `pyspelling -c .spellcheck.yml` to do spellcheck locally
[.wordlist.txt](.wordlist.txt) |Whitelisted words for the spell checker, use `pyspelling -c .spellcheck.yml` to do spellcheck locally
[.markdownlint.jsonc](.markdownlint.jsonc)|Configuration of the markdown linter, use `markdownlint "**/*.md"` to do markdown linting locally. The name of this file is a default name.
[.markdownlintignore](.markdownlintignore)|Files ignored by the markdown linter, use `markdownlint "**/*.md"` to do markdown linting locally. The name of this file is a default name.

Loading

0 comments on commit 57e9295

Please sign in to comment.