11---
22name : CI
3-
3+ # yamllint disable rule:truthy rule:line-length
44on :
5+ pull_request :
56 push :
67 branches :
7- - " main"
8- pull_request :
8+ - main
9+
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ cancel-in-progress : true
13+
14+ permissions :
15+ contents : read
916
1017jobs :
11- lint :
18+ files-changed :
19+ name : Detect which files have changed
20+ runs-on : ubuntu-latest
21+ timeout-minutes : 5
22+ outputs :
23+ documentation : ${{ steps.changes.outputs.documentation_all }}
24+ go : ${{ steps.changes.outputs.go_all }}
25+ yaml : ${{ steps.changes.outputs.yaml_all }}
26+ markdown : ${{ steps.changes.outputs.markdown_all }}
27+ steps :
28+ - uses : actions/checkout@v5
29+ - name : Check for file changes
30+ uses : opsmill/paths-filter@v3.0.2
31+ id : changes
32+ with :
33+ token : ${{ github.token }}
34+ filters : .github/file-filters.yml
35+
36+ go-lint :
37+ if : needs.files-changed.outputs.go == 'true'
38+ needs : ["files-changed"]
1239 runs-on : ubuntu-24.04
40+ timeout-minutes : 5
1341 steps :
14- - name : " Check out repository code"
42+ - name : Check out repository code
1543 uses : actions/checkout@v5
1644
1745 - name : Set up Go
1846 uses : actions/setup-go@v6
1947 with :
20- go-version : " 1.25 "
48+ go-version : " 1.23 "
2149
2250 - name : Build watchdog
2351 run : make build-watchdog
@@ -28,17 +56,91 @@ jobs:
2856 version : v2.1
2957
3058 test :
59+ if : needs.files-changed.outputs.go == 'true'
60+ needs : ["files-changed", "go-lint"]
3161 runs-on : ubuntu-24.04
62+ timeout-minutes : 10
3263 steps :
3364 - uses : actions/checkout@v5
3465
3566 - name : Set up Go
3667 uses : actions/setup-go@v6
3768 with :
38- go-version : " 1.25 "
69+ go-version : " 1.23 "
3970
4071 - name : Build watchdog
4172 run : make build-watchdog
4273
4374 - name : Run tests
4475 run : make test
76+
77+ yaml-lint :
78+ if : needs.files-changed.outputs.yaml == 'true'
79+ needs : ["files-changed"]
80+ runs-on : ubuntu-latest
81+ timeout-minutes : 5
82+ steps :
83+ - uses : actions/checkout@v5
84+ - name : Install yamllint
85+ run : pip install yamllint
86+ - name : Run yamllint
87+ run : yamllint -s .
88+
89+ markdown-lint :
90+ if : needs.files-changed.outputs.markdown == 'true'
91+ needs : ["files-changed"]
92+ runs-on : ubuntu-latest
93+ timeout-minutes : 5
94+ steps :
95+ - uses : actions/checkout@v5
96+ - uses : actions/setup-node@v4
97+ with :
98+ node-version : 20
99+ - name : Install markdownlint-cli
100+ run : npm install -g markdownlint-cli
101+ - name : Run markdownlint
102+ run : markdownlint "**/*.md" --ignore node_modules --ignore docs/node_modules
103+
104+ validate-documentation-style :
105+ if : |
106+ always() && !cancelled() &&
107+ !contains(needs.*.result, 'failure') &&
108+ !contains(needs.*.result, 'cancelled') &&
109+ needs.files-changed.outputs.documentation == 'true'
110+ needs : ["files-changed", "yaml-lint", "markdown-lint"]
111+ runs-on : ubuntu-22.04
112+ timeout-minutes : 5
113+ env :
114+ VALE_VERSION : " 3.13.0"
115+ steps :
116+ - uses : actions/checkout@v5
117+ - name : Download Vale
118+ run : |
119+ curl -sL "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz
120+ tar -xzf vale.tar.gz
121+ - name : Validate documentation style
122+ run : ./vale $(find ./docs/docs -type f \( -name "*.mdx" -o -name "*.md" \))
123+
124+ documentation :
125+ defaults :
126+ run :
127+ working-directory : ./docs
128+ if : |
129+ always() && !cancelled() &&
130+ !contains(needs.*.result, 'failure') &&
131+ !contains(needs.*.result, 'cancelled') &&
132+ needs.files-changed.outputs.documentation == 'true'
133+ needs : ["files-changed", "yaml-lint", "markdown-lint"]
134+ runs-on : ubuntu-22.04
135+ timeout-minutes : 5
136+ steps :
137+ - uses : actions/checkout@v5
138+ - uses : actions/setup-node@v4
139+ with :
140+ node-version : 20
141+ cache : ' npm'
142+ cache-dependency-path : docs/package-lock.json
143+ - name : Install Node dependencies
144+ run : npm install
145+ - name : Build docs website
146+ run : npm run build
0 commit comments