1
- name : coder
1
+ name : ci
2
2
3
3
on :
4
4
push :
@@ -28,109 +28,44 @@ concurrency:
28
28
cancel-in-progress : ${{ github.event_name == 'pull_request' }}
29
29
30
30
jobs :
31
- typos :
32
- runs-on : ubuntu-latest
31
+ lint :
32
+ runs-on : ${{ github.repository_owner == 'coder' && ' ubuntu-latest-16-cores' || 'ubuntu-latest' }}
33
33
steps :
34
34
- name : Checkout
35
- uses : actions/checkout@v2
36
- - name : typos-action
35
+ uses : actions/checkout@v3
36
+
37
+ # Install Go!
38
+ - uses : actions/setup-go@v3
39
+ with :
40
+ go-version : " ~1.19"
41
+
42
+ # Check for any typos!
43
+ - name : Check for typos
37
44
uses : crate-ci/typos@v1.13.3
38
45
with :
39
46
config : .github/workflows/typos.toml
40
- - name : Fix Helper
47
+ - name : Fix the typos
41
48
if : ${{ failure() }}
42
49
run : |
43
50
echo "::notice:: you can automatically fix typos from your CLI:
44
51
cargo install typos-cli
45
52
typos -c .github/workflows/typos.toml -w"
46
53
47
- changes :
48
- runs-on : ubuntu-latest
49
- outputs :
50
- docs-only : ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
51
- sh : ${{ steps.filter.outputs.sh }}
52
- ts : ${{ steps.filter.outputs.ts }}
53
- k8s : ${{ steps.filter.outputs.k8s }}
54
- steps :
55
- - uses : actions/checkout@v3
56
- # For pull requests it's not necessary to checkout the code
57
- - uses : dorny/paths-filter@v2
58
- id : filter
59
- with :
60
- filters : |
61
- all:
62
- - '**'
63
- docs:
64
- - 'docs/**'
65
- # For testing:
66
- # - '.github/**'
67
- sh:
68
- - "**.sh"
69
- ts:
70
- - 'site/**'
71
- k8s:
72
- - 'helm/**'
73
- - Dockerfile
74
- - scripts/helm.sh
75
- - id : debug
76
- run : |
77
- echo "${{ toJSON(steps.filter )}}"
78
-
79
- # Debug step
80
- debug-inputs :
81
- needs :
82
- - changes
83
- runs-on : ubuntu-latest
84
- steps :
85
- - id : log
86
- run : |
87
- echo "${{ toJSON(needs) }}"
88
-
89
- style-lint-golangci :
90
- name : style/lint/golangci
91
- timeout-minutes : 5
92
- runs-on : ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
93
- steps :
94
- - uses : actions/checkout@v3
95
- - uses : actions/setup-go@v3
96
- with :
97
- go-version : " ~1.19"
98
- - name : golangci-lint
54
+ # Check for Go linting errors!
55
+ - name : Lint Go
99
56
uses : golangci/golangci-lint-action@v3.3.1
100
57
with :
101
58
version : v1.48.0
102
59
103
- check-enterprise-imports :
104
- name : check/enterprise-imports
105
- timeout-minutes : 5
106
- runs-on : ubuntu-latest
107
- steps :
108
- - uses : actions/checkout@v3
109
- - name : Check imports of enterprise code
110
- run : ./scripts/check_enterprise_imports.sh
111
-
112
- style-lint-shellcheck :
113
- name : style/lint/shellcheck
114
- timeout-minutes : 5
115
- runs-on : ubuntu-latest
116
- steps :
117
- - uses : actions/checkout@v3
118
- - name : Run ShellCheck
60
+ - name : Lint shell scripts
119
61
uses : ludeeus/action-shellcheck@1.1.0
120
62
env :
121
63
SHELLCHECK_OPTS : --external-sources
122
64
with :
123
65
ignore : node_modules
124
66
125
- style-lint-typescript :
126
- name : " style/lint/typescript"
127
- timeout-minutes : 5
128
- runs-on : ubuntu-latest
129
- steps :
130
- - name : Checkout
131
- uses : actions/checkout@v3
132
-
133
- - name : Cache Node
67
+ # Lint our dashboard!
68
+ - name : Cache node_modules
134
69
id : cache-node
135
70
uses : actions/cache@v3
136
71
with :
@@ -140,36 +75,79 @@ jobs:
140
75
key : js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }}
141
76
restore-keys : |
142
77
js-${{ runner.os }}-
143
-
144
78
- name : Install node_modules
145
79
run : ./scripts/yarn_install.sh
146
-
147
- - name : " yarn lint"
80
+ - name : Lint TypeScript
148
81
run : yarn lint
149
82
working-directory : site
150
83
151
- style-lint-k8s :
152
- name : " style/lint/k8s"
153
- timeout-minutes : 5
154
- needs : changes
155
- if : needs.changes.outputs.k8s == 'true'
156
- runs-on : ubuntu-latest
157
- steps :
158
- - name : Checkout
159
- uses : actions/checkout@v3
160
-
84
+ # Make sure the Helm chart is linted!
161
85
- name : Install helm
162
86
uses : azure/setup-helm@v3
163
87
with :
164
88
version : v3.9.2
165
-
166
- - name : cd helm && make lint
89
+ - name : Lint Helm chart
167
90
run : |
168
91
cd helm
169
92
make lint
170
93
94
+ # Check for dead links in our markdown!
95
+ # For the main branch:
96
+ - if : github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
97
+ uses : gaurav-nelson/github-action-markdown-link-check@v1
98
+ name : Check for dead links (main)
99
+ with :
100
+ use-quiet-mode : yes
101
+ use-verbose-mode : yes
102
+ config-file : .github/workflows/mlc_config.json
103
+ # For pull requests:
104
+ - if : github.ref != 'refs/heads/main' || github.event.pull_request.head.repo.fork
105
+ uses : gaurav-nelson/github-action-markdown-link-check@v1
106
+ name : Check for dead links (pull request)
107
+ with :
108
+ use-quiet-mode : yes
109
+ use-verbose-mode : yes
110
+ check-modified-files-only : yes
111
+ base-branch : main
112
+ config-file : .github/workflows/mlc_config.json
113
+
114
+ # Ensure AGPL and Enterprise are separated!
115
+ - name : Check for AGPL code importing Enterprise...
116
+ run : ./scripts/check_enterprise_imports.sh
117
+
118
+ changes :
119
+ runs-on : ubuntu-latest
120
+ outputs :
121
+ docs-only : ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
122
+ sh : ${{ steps.filter.outputs.sh }}
123
+ ts : ${{ steps.filter.outputs.ts }}
124
+ k8s : ${{ steps.filter.outputs.k8s }}
125
+ steps :
126
+ - uses : actions/checkout@v3
127
+ # For pull requests it's not necessary to checkout the code
128
+ - uses : dorny/paths-filter@v2
129
+ id : filter
130
+ with :
131
+ filters : |
132
+ all:
133
+ - '**'
134
+ docs:
135
+ - 'docs/**'
136
+ # For testing:
137
+ # - '.github/**'
138
+ sh:
139
+ - "**.sh"
140
+ ts:
141
+ - 'site/**'
142
+ k8s:
143
+ - 'helm/**'
144
+ - Dockerfile
145
+ - scripts/helm.sh
146
+ - id : debug
147
+ run : |
148
+ echo "${{ toJSON(steps.filter )}}"
149
+
171
150
gen :
172
- name : " style/gen"
173
151
timeout-minutes : 8
174
152
runs-on : ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
175
153
needs : changes
@@ -243,8 +221,7 @@ jobs:
243
221
- name : Check for unstaged files
244
222
run : ./scripts/check_unstaged.sh
245
223
246
- style-fmt :
247
- name : " style/fmt"
224
+ fmt :
248
225
runs-on : ubuntu-latest
249
226
timeout-minutes : 5
250
227
steps :
@@ -280,7 +257,6 @@ jobs:
280
257
run : ./scripts/check_unstaged.sh
281
258
282
259
test-go :
283
- name : " test/go"
284
260
runs-on : ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }}
285
261
timeout-minutes : 20
286
262
strategy :
@@ -365,8 +341,7 @@ jobs:
365
341
files : ./gotests.coverage
366
342
flags : unittest-go-${{ matrix.os }}
367
343
368
- test-go-postgres :
369
- name : " test/go/postgres"
344
+ test-go-psql :
370
345
runs-on : ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
371
346
# This timeout must be greater than the timeout set by `go test` in
372
347
# `make test-postgres` to ensure we receive a trace of running
@@ -532,7 +507,6 @@ jobs:
532
507
retention-days : 7
533
508
534
509
test-js :
535
- name : " test/js"
536
510
runs-on : ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
537
511
timeout-minutes : 20
538
512
steps :
@@ -572,16 +546,11 @@ jobs:
572
546
flags : unittest-js
573
547
574
548
test-e2e :
575
- name : " test/e2e/${{ matrix.os }}"
576
549
needs :
577
550
- changes
578
551
if : needs.changes.outputs.docs-only == 'false'
579
- runs-on : ${{ matrix.os }}
552
+ runs-on : ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
580
553
timeout-minutes : 20
581
- strategy :
582
- matrix :
583
- os :
584
- - ubuntu-latest
585
554
steps :
586
555
- uses : actions/checkout@v3
587
556
@@ -693,23 +662,3 @@ jobs:
693
662
buildScriptName : " storybook:build"
694
663
projectToken : 695c25b6cb65
695
664
workingDir : " ./site"
696
- markdown-link-check :
697
- runs-on : ubuntu-latest
698
- steps :
699
- - uses : actions/checkout@master
700
- # For the main branch:
701
- - if : github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
702
- uses : gaurav-nelson/github-action-markdown-link-check@v1
703
- with :
704
- use-quiet-mode : yes
705
- use-verbose-mode : yes
706
- config-file : .github/workflows/mlc_config.json
707
- # For pull requests:
708
- - if : github.ref != 'refs/heads/main' || github.event.pull_request.head.repo.fork
709
- uses : gaurav-nelson/github-action-markdown-link-check@v1
710
- with :
711
- use-quiet-mode : yes
712
- use-verbose-mode : yes
713
- check-modified-files-only : yes
714
- base-branch : main
715
- config-file : .github/workflows/mlc_config.json
0 commit comments