Repository navigation
86 lines (74 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
86 lines (74 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes expect jq
# Ubuntu's direnv 2.32.1 expands shell metacharacters in project paths.
# Pin a release containing the upstream path-escaping fix (2.32.2+).
curl --fail --location --silent --show-error \
https://github.com/direnv/direnv/releases/download/v2.37.1/direnv.linux-amd64 \
--output "$RUNNER_TEMP/direnv"
printf '%s %s\n' \
1f1b93dd6f38523fde26dfac96151ef9d31a374e3005cd3345fb93555ae0c9b5 \
"$RUNNER_TEMP/direnv" | sha256sum --check
sudo install -m 0755 "$RUNNER_TEMP/direnv" /usr/local/bin/direnv
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install direnv jq
- name: Check Bash syntax
shell: bash
run: |
for script in bin/* tests/*.sh; do
bash -n "$script"
done
- name: Run tests
run: ./tests/test.sh
documentation:
name: Documentation checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install documentation checkers
run: |
npm install --global markdown-link-check@3.13.7
npm install --global @mermaid-js/mermaid-cli@11.12.0
- name: Check Markdown links
run: |
find . -type f -name '*.md' -not -path './.git/*' -print0 \
| xargs -0 -n 1 markdown-link-check \
--config .github/markdown-link-check.json
- name: Check Mermaid syntax
shell: bash
run: |
mapfile -t diagrams < <(grep -RIl '^```mermaid' \
--include='*.md' --exclude-dir=.git .)
for index in "${!diagrams[@]}"; do
mmdc --quiet \
--input "${diagrams[$index]}" \
--output "${RUNNER_TEMP}/mermaid-${index}.md" \
--puppeteerConfigFile .github/mermaid-puppeteer.json
done