@@ -100,49 +100,45 @@ jobs:
100
100
101
101
- uses : ./.github/actions/setup-go
102
102
103
- # Check for any typos!
103
+ - uses : ./.github/actions/setup-node
104
+
105
+ - name : Get golangci-lint cache dir
106
+ run : |
107
+ go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
108
+ dir=$(golangci-lint cache status | awk '/Dir/ { print $2 }')
109
+ echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV
110
+
111
+ - name : golangci-lint cache
112
+ uses : buildjet/cache@v3
113
+ with :
114
+ path : |
115
+ ${{ env.LINT_CACHE_DIR }}
116
+ key : golangci-lint-${{ runner.os }}-${{ hashFiles('**/*.go') }}
117
+ restore-keys : |
118
+ golangci-lint-${{ runner.os }}-
119
+
120
+ # Check for any typos
104
121
- name : Check for typos
105
122
uses : crate-ci/typos@v1.14.12
106
123
with :
107
124
config : .github/workflows/typos.toml
125
+
108
126
- name : Fix the typos
109
127
if : ${{ failure() }}
110
128
run : |
111
129
echo "::notice:: you can automatically fix typos from your CLI:
112
130
cargo install typos-cli
113
131
typos -c .github/workflows/typos.toml -w"
114
132
115
- # Check for Go linting errors!
116
- - name : Lint Go
117
- uses : golangci/golangci-lint-action@v3.5.0
118
- with :
119
- version : v1.52.2
120
-
121
- - name : Lint shell scripts
122
- uses : ludeeus/action-shellcheck@2.0.0
123
- env :
124
- SHELLCHECK_OPTS : --external-sources
125
- with :
126
- ignore : node_modules
127
-
128
- - uses : ./.github/actions/setup-node
129
- - name : Lint TypeScript
130
- run : yarn lint
131
- working-directory : site
132
-
133
- # Make sure the Helm chart is linted!
133
+ # Needed for helm chart linting
134
134
- name : Install helm
135
135
uses : azure/setup-helm@v3
136
136
with :
137
137
version : v3.9.2
138
- - name : Lint Helm chart
139
- run : |
140
- cd helm
141
- make lint
142
138
143
- # Ensure AGPL and Enterprise are separated!
144
- - name : Check for AGPL code importing Enterprise...
145
- run : ./scripts/check_enterprise_imports.sh
139
+ - name : make lint
140
+ run : |
141
+ make --output-sync=line -j lint
146
142
147
143
gen :
148
144
timeout-minutes : 8
@@ -158,16 +154,14 @@ jobs:
158
154
- name : Install sqlc
159
155
run : |
160
156
curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.17.2/sqlc_1.17.2_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc
161
- - name : Install protoc-gen-go
162
- run : go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30
163
- - name : Install protoc-gen-go-drpc
164
- run : go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
165
- - name : Install goimports
166
- run : go install golang.org/x/tools/cmd/goimports@latest
167
- - name : Install yq
168
- run : go run github.com/mikefarah/yq/v4@v4.30.6
169
- - name : Install mockgen
170
- run : go install github.com/golang/mock/mockgen@v1.6.0
157
+
158
+ - name : go install tools
159
+ run : |
160
+ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30
161
+ go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.33
162
+ go install golang.org/x/tools/cmd/goimports@latest
163
+ go install github.com/mikefarah/yq/v4@v4.30.6
164
+ go install github.com/golang/mock/mockgen@v1.6.0
171
165
172
166
- name : Install Protoc
173
167
run : |
@@ -189,7 +183,7 @@ jobs:
189
183
run : ./scripts/check_unstaged.sh
190
184
191
185
fmt :
192
- runs-on : ubuntu-latest
186
+ runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu- ubuntu-2204' || 'ubuntu- latest' }}
193
187
timeout-minutes : 5
194
188
steps :
195
189
- name : Checkout
@@ -250,11 +244,6 @@ jobs:
250
244
# By default Go will use the number of logical CPUs, which
251
245
# is a fine default.
252
246
PARALLEL_FLAG=""
253
- if [ "${{ matrix.os }}" == "windows-2019" ]; then
254
- # Windows appears more I/O bound, so we increase parallelism
255
- # to make better use of CPU.
256
- PARALLEL_FLAG="-parallel=16"
257
- fi
258
247
259
248
export TS_DEBUG_DISCO=true
260
249
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" \
@@ -268,7 +257,7 @@ jobs:
268
257
go run ./scripts/ci-report/main.go gotests.json | tee gotests_stats.json
269
258
270
259
- uses : ./.github/actions/upload-datadog
271
- if : always ()
260
+ if : success() || failure ()
272
261
with :
273
262
api-key : ${{ secrets.DATADOG_API_KEY }}
274
263
@@ -315,15 +304,8 @@ jobs:
315
304
# so we need to print the test stats to the log.
316
305
go run ./scripts/ci-report/main.go gotests.json | tee gotests_stats.json
317
306
318
- - uses : actions/upload-artifact@v3
319
- if : success() || failure()
320
- with :
321
- name : gotests-postgres.xml
322
- path : ./gotests.xml
323
- retention-days : 30
324
-
325
307
- uses : ./.github/actions/upload-datadog
326
- if : always ()
308
+ if : success() || failure ()
327
309
with :
328
310
api-key : ${{ secrets.DATADOG_API_KEY }}
329
311
@@ -349,11 +331,6 @@ jobs:
349
331
350
332
- uses : ./.github/actions/setup-go
351
333
352
- - uses : hashicorp/setup-terraform@v2
353
- with :
354
- terraform_version : 1.1.9
355
- terraform_wrapper : false
356
-
357
334
- name : Run Tests
358
335
run : |
359
336
gotestsum --junitfile="gotests.xml" -- -race ./...
0 commit comments