Skip to content

Commit 1e3fa7c

Browse files
committed
Merge branch 'main' into parameter
2 parents b9dcfc3 + df89e2c commit 1e3fa7c

File tree

806 files changed

+37033
-8545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

806 files changed

+37033
-8545
lines changed

.github/workflows/cla.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
8+
jobs:
9+
CLAssistant:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "CLA Assistant"
13+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14+
uses: contributor-assistant/github-action@v2.2.1
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
# the below token should have repo scope and must be manually added by you in the repository's secret
18+
PERSONAL_ACCESS_TOKEN : ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
19+
with:
20+
remote-organization-name: 'coder'
21+
remote-repository-name: 'cla'
22+
path-to-signatures: 'v2022-09-04/signatures.json'
23+
path-to-document: 'https://github.com/coder/cla/blob/main/README.md'
24+
# branch should not be protected
25+
branch: 'main'
26+
allowlist: dependabot*

.github/workflows/coder.yaml

+15-32
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "*"
97

108
pull_request:
119

@@ -36,7 +34,7 @@ jobs:
3634
- name: Checkout
3735
uses: actions/checkout@v2
3836
- name: typos-action
39-
uses: crate-ci/typos@master
37+
uses: crate-ci/typos@v1.12.8
4038
with:
4139
config: .github/workflows/typos.toml
4240
- name: Fix Helper
@@ -64,12 +62,10 @@ jobs:
6462
- '**'
6563
docs:
6664
- 'docs/**'
65+
# For testing:
66+
# - '.github/**'
6767
sh:
6868
- "**.sh"
69-
go:
70-
- "**.go"
71-
tf:
72-
- "**.tf"
7369
ts:
7470
- 'site/**'
7571
k8s:
@@ -94,8 +90,6 @@ jobs:
9490
name: style/lint/golangci
9591
timeout-minutes: 5
9692
runs-on: ubuntu-latest
97-
needs: changes
98-
if: needs.changes.outputs.go == 'true'
9993
steps:
10094
- uses: actions/checkout@v3
10195
- uses: actions/setup-go@v3
@@ -119,8 +113,6 @@ jobs:
119113
name: style/lint/shellcheck
120114
timeout-minutes: 5
121115
runs-on: ubuntu-latest
122-
needs: changes
123-
if: needs.changes.outputs.sh == 'true'
124116
steps:
125117
- uses: actions/checkout@v3
126118
- name: Run ShellCheck
@@ -134,8 +126,6 @@ jobs:
134126
name: "style/lint/typescript"
135127
timeout-minutes: 5
136128
runs-on: ubuntu-latest
137-
needs: changes
138-
if: needs.changes.outputs.ts == 'true'
139129
steps:
140130
- name: Checkout
141131
uses: actions/checkout@v3
@@ -255,8 +245,6 @@ jobs:
255245
name: "style/fmt"
256246
runs-on: ubuntu-latest
257247
timeout-minutes: 5
258-
needs: changes
259-
if: needs.changes.outputs.sh == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.tf == 'true'
260248
steps:
261249
- name: Checkout
262250
uses: actions/checkout@v3
@@ -290,7 +278,6 @@ jobs:
290278
name: "test/go"
291279
runs-on: ${{ matrix.os }}
292280
timeout-minutes: 20
293-
needs: changes
294281
strategy:
295282
matrix:
296283
os:
@@ -299,36 +286,30 @@ jobs:
299286
- windows-2022
300287
steps:
301288
- uses: actions/checkout@v3
302-
if: needs.changes.outputs.go == 'true'
303289

304290
- uses: actions/setup-go@v3
305-
if: needs.changes.outputs.go == 'true'
306291
with:
307292
go-version: "~1.19"
308293

309294
- name: Echo Go Cache Paths
310-
if: needs.changes.outputs.go == 'true'
311295
id: go-cache-paths
312296
run: |
313297
echo "::set-output name=go-build::$(go env GOCACHE)"
314298
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
315299
316300
- name: Go Build Cache
317-
if: needs.changes.outputs.go == 'true'
318301
uses: actions/cache@v3
319302
with:
320303
path: ${{ steps.go-cache-paths.outputs.go-build }}
321304
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
322305

323306
- name: Go Mod Cache
324-
if: needs.changes.outputs.go == 'true'
325307
uses: actions/cache@v3
326308
with:
327309
path: ${{ steps.go-cache-paths.outputs.go-mod }}
328310
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
329311

330312
- name: Install gotestsum
331-
if: needs.changes.outputs.go == 'true'
332313
uses: jaxxstorm/action-install-gh-release@v1.7.1
333314
env:
334315
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -337,13 +318,11 @@ jobs:
337318
tag: v1.7.0
338319

339320
- uses: hashicorp/setup-terraform@v2
340-
if: needs.changes.outputs.go == 'true'
341321
with:
342322
terraform_version: 1.1.9
343323
terraform_wrapper: false
344324

345325
- name: Test with Mock Database
346-
if: needs.changes.outputs.go == 'true'
347326
id: test
348327
shell: bash
349328
run: |
@@ -369,7 +348,7 @@ jobs:
369348
# that is no guarantee, see:
370349
# https://github.com/codecov/codecov-action/issues/788
371350
continue-on-error: true
372-
if: steps.test.outputs.cover && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && needs.changes.outputs.go == 'true'
351+
if: steps.test.outputs.cover && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
373352
with:
374353
token: ${{ secrets.CODECOV_TOKEN }}
375354
files: ./gotests.coverage
@@ -383,8 +362,6 @@ jobs:
383362
# goroutines. Setting this to the timeout +5m should work quite well
384363
# even if some of the preceding steps are slow.
385364
timeout-minutes: 25
386-
needs: changes
387-
if: needs.changes.outputs.go == 'true'
388365
steps:
389366
- uses: actions/checkout@v3
390367

@@ -539,8 +516,6 @@ jobs:
539516
name: "test/js"
540517
runs-on: ubuntu-latest
541518
timeout-minutes: 20
542-
needs: changes
543-
if: needs.changes.outputs.ts == 'true'
544519
steps:
545520
- uses: actions/checkout@v3
546521

@@ -579,8 +554,9 @@ jobs:
579554

580555
test-e2e:
581556
name: "test/e2e/${{ matrix.os }}"
582-
needs: changes
583-
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.tf == 'true'
557+
needs:
558+
- changes
559+
if: needs.changes.outputs.docs-only == 'false'
584560
runs-on: ${{ matrix.os }}
585561
timeout-minutes: 20
586562
strategy:
@@ -652,7 +628,7 @@ jobs:
652628
with:
653629
name: failed-test-videos
654630
path: ./site/test-results/**/*.webm
655-
retention:days: 7
631+
retention-days: 7
656632

657633
chromatic:
658634
# REMARK: this is only used to build storybook and deploy it to Chromatic.
@@ -698,3 +674,10 @@ jobs:
698674
buildScriptName: "storybook:build"
699675
projectToken: 695c25b6cb65
700676
workingDir: "./site"
677+
markdown-link-check:
678+
runs-on: ubuntu-latest
679+
steps:
680+
- uses: actions/checkout@master
681+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
682+
with:
683+
config-file: .github/workflows/mlc_config.json

.github/workflows/dogfood.yaml

+26-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "*"
97
paths:
108
- "dogfood/**"
119
pull_request:
@@ -14,12 +12,12 @@ on:
1412
workflow_dispatch:
1513

1614
jobs:
17-
deploy:
15+
deploy_image:
1816
runs-on: ubuntu-latest
1917
steps:
2018
- name: Get branch name
2119
id: branch-name
22-
uses: tj-actions/branch-names@v5.4
20+
uses: tj-actions/branch-names@v6.1
2321

2422
- name: "Branch name to Docker tag name"
2523
id: docker-tag-name
@@ -49,3 +47,27 @@ jobs:
4947
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
5048
cache-from: type=registry,ref=codercom/oss-dogfood:latest
5149
cache-to: type=inline
50+
deploy_template:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
- name: Get short commit SHA
56+
id: vars
57+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
58+
- name: "Install latest Coder"
59+
run: |
60+
curl -L https://coder.com/install.sh | sh
61+
# env:
62+
# VERSION: 0.x
63+
- name: "Push template"
64+
run: |
65+
coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
66+
env:
67+
# Consumed by Coder CLI
68+
CODER_URL: https://dev.coder.com
69+
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
70+
# Template source & details
71+
CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
72+
CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
73+
CODER_TEMPLATE_DIR: ./dogfood

.github/workflows/mlc_config.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": ":\/\/localhost"
5+
},
6+
{
7+
"pattern": ":\/\/.*.?example\\.com"
8+
},
9+
{
10+
"pattern": "developer.github.com"
11+
},
12+
{
13+
"pattern": "tailscale.com"
14+
}
15+
]
16+
}

.github/workflows/release.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ jobs:
6565
restore-keys: |
6666
js-${{ runner.os }}-
6767
68+
- name: Install nsis and zstd
69+
run: sudo apt-get install -y nsis zstd
70+
6871
- name: Install nfpm
6972
run: |
7073
set -euo pipefail
7174
wget -O /tmp/nfpm.deb https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb
7275
sudo dpkg -i /tmp/nfpm.deb
73-
- name: Install zstd
74-
run: sudo apt-get install -y zstd
7576
7677
- name: Install rcodesign
7778
run: |
@@ -107,6 +108,7 @@ jobs:
107108
make -j \
108109
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
109110
build/coder_"$version"_{darwin,windows}_{amd64,arm64}.zip \
111+
build/coder_"$version"_windows_amd64_installer.exe \
110112
build/coder_helm_"$version".tgz
111113
env:
112114
CODER_SIGN_DARWIN: "1"
@@ -155,6 +157,7 @@ jobs:
155157
run: |
156158
./scripts/publish_release.sh \
157159
${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \
160+
./build/*_installer.exe \
158161
./build/*.zip \
159162
./build/*.tar.gz \
160163
./build/*.tgz \

.github/workflows/stale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
# v5.1.0 has a weird bug that makes stalebot add then remove its own label
1515
# https://github.com/actions/stale/pull/775
16-
- uses: actions/stale@v5.0.0
16+
- uses: actions/stale@v6.0.0
1717
with:
1818
stale-issue-label: stale
1919
stale-pr-label: stale

.github/workflows/typos.toml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ IST = "IST"
55
MacOS = "macOS"
66

77
[default.extend-words]
8+
# do as sudo replacement
9+
doas = "doas"
810

911
[files]
1012
extend-exclude = [

.golangci.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,15 @@ linters:
235235
- noctx
236236
- paralleltest
237237
- revive
238-
- rowserrcheck
239-
- sqlclosecheck
238+
239+
# These don't work until the following issue is solved.
240+
# https://github.com/golangci/golangci-lint/issues/2649
241+
# - rowserrcheck
242+
# - sqlclosecheck
243+
# - structcheck
244+
# - wastedassign
245+
240246
- staticcheck
241-
- structcheck
242247
- tenv
243248
# In Go, it's possible for a package to test it's internal functionality
244249
# without testing any exported functions. This is enabled to promote
@@ -253,4 +258,3 @@ linters:
253258
- unconvert
254259
- unused
255260
- varcheck
256-
- wastedassign

0 commit comments

Comments
 (0)