Skip to content

Commit c730d68

Browse files
committed
Merge branch 'main' of github.com:coder/coder into spike/3042_azure_example_template
2 parents b065bfd + a848e71 commit c730d68

File tree

260 files changed

+5233
-1398
lines changed

Some content is hidden

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

260 files changed

+5233
-1398
lines changed

.github/codecov.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ github_checks:
99
annotations: false
1010

1111
coverage:
12+
range: 50..75
13+
round: down
14+
precision: 2
1215
status:
1316
patch:
1417
default:
1518
informational: yes
1619
project:
1720
default:
18-
target: 70%
19-
informational: yes
21+
target: 65%
22+
informational: true
2023

2124
ignore:
2225
# This is generated code.

.github/dependabot.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "monthly"
77
time: "06:00"
88
timezone: "America/Chicago"
99
labels: []
@@ -28,23 +28,32 @@ updates:
2828
- package-ecosystem: "gomod"
2929
directory: "/"
3030
schedule:
31-
interval: "weekly"
31+
interval: "monthly"
3232
time: "06:00"
3333
timezone: "America/Chicago"
3434
commit-message:
3535
prefix: "chore"
3636
labels: []
37+
ignore:
38+
# Ignore patch updates for all dependencies
39+
- dependency-name: "*"
40+
update-types:
41+
- version-update:semver-patch
3742

3843
- package-ecosystem: "npm"
3944
directory: "/site/"
4045
schedule:
41-
interval: "weekly"
46+
interval: "monthly"
4247
time: "06:00"
4348
timezone: "America/Chicago"
4449
commit-message:
4550
prefix: "chore"
4651
labels: []
4752
ignore:
53+
# Ignore patch updates for all dependencies
54+
- dependency-name: "*"
55+
update-types:
56+
- version-update:semver-patch
4857
# Ignore major updates to Node.js types, because they need to
4958
# correspond to the Node.js engine version
5059
- dependency-name: "@types/node"
@@ -54,7 +63,7 @@ updates:
5463
- package-ecosystem: "terraform"
5564
directory: "/examples/templates"
5665
schedule:
57-
interval: "weekly"
66+
interval: "monthly"
5867
time: "06:00"
5968
timezone: "America/Chicago"
6069
commit-message:

.github/workflows/chromatic.yaml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/coder.yaml

Lines changed: 69 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ concurrency:
3030
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3131

3232
jobs:
33+
typos:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: typos-action
39+
uses: crate-ci/typos@v1.0.4
40+
with:
41+
config: .github/workflows/typos.toml
42+
- name: Fix Helper
43+
if: ${{ failure() }}
44+
run: |
45+
echo "::notice:: you can automatically fix typos from your CLI:
46+
cargo install typos-cli
47+
typos -c .github/workflows/typos.toml -w"
48+
3349
changes:
3450
runs-on: ubuntu-latest
3551
outputs:
3652
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
37-
go: ${{ steps.filter.outputs.go }}
3853
sh: ${{ steps.filter.outputs.sh }}
54+
ts: ${{ steps.filter.outputs.ts }}
3955
steps:
4056
- uses: actions/checkout@v3
4157
# For pull requests it's not necessary to checkout the code
@@ -49,12 +65,10 @@ jobs:
4965
- 'docs/**'
5066
# For testing:
5167
# - '.github/**'
52-
go:
53-
- "**.go"
54-
- "**.mod"
55-
- "**.sum"
5668
sh:
5769
- "**.sh"
70+
ts:
71+
- 'site/**'
5872
- id: debug
5973
run: |
6074
echo "${{ toJSON(steps.filter )}}"
@@ -63,36 +77,15 @@ jobs:
6377
debug-inputs:
6478
needs:
6579
- changes
66-
- pr-context
6780
runs-on: ubuntu-latest
6881
steps:
6982
- id: log
7083
run: |
7184
echo "${{ toJSON(needs) }}"
72-
echo "${{ contains(needs.pr-context.outputs.skips, 'test/go/postgres') }} "
73-
echo "${{ contains(needs.pr-context.outputs.skips, 'test/e2e') }} "
74-
75-
pr-context:
76-
runs-on: ubuntu-latest
77-
outputs:
78-
skips: ${{ steps.pr-context.outputs.skips }}
79-
steps:
80-
- uses: actions/checkout@v3
81-
- uses: actions/setup-go@v3
82-
with:
83-
go-version: "~1.18"
84-
- id: pr-context
85-
env:
86-
GITHUB_CONTEXT: ${{ toJSON(github) }}
87-
run: |
88-
(cd .github/workflows/prcontext && go build)
89-
./.github/workflows/prcontext/prcontext
9085
9186
style-lint-golangci:
9287
name: style/lint/golangci
9388
timeout-minutes: 5
94-
needs: changes
95-
if: needs.changes.outputs.go == 'true'
9689
runs-on: ubuntu-latest
9790
steps:
9891
- uses: actions/checkout@v3
@@ -108,8 +101,6 @@ jobs:
108101
name: style/lint/shellcheck
109102
timeout-minutes: 5
110103
runs-on: ubuntu-latest
111-
needs: changes
112-
if: needs.changes.outputs.sh == 'true'
113104
steps:
114105
- uses: actions/checkout@v3
115106
- name: Run ShellCheck
@@ -122,8 +113,6 @@ jobs:
122113
style-lint-typescript:
123114
name: "style/lint/typescript"
124115
timeout-minutes: 5
125-
needs: changes
126-
if: needs.changes.outputs.docs-only == 'false'
127116
runs-on: ubuntu-latest
128117
steps:
129118
- name: Checkout
@@ -207,8 +196,6 @@ jobs:
207196

208197
style-fmt:
209198
name: "style/fmt"
210-
needs: changes
211-
if: needs.changes.outputs.docs-only == 'false'
212199
runs-on: ubuntu-latest
213200
timeout-minutes: 5
214201
steps:
@@ -241,8 +228,6 @@ jobs:
241228
242229
test-go:
243230
name: "test/go"
244-
needs: changes
245-
if: needs.changes.outputs.docs-only == 'false'
246231
runs-on: ${{ matrix.os }}
247232
timeout-minutes: 20
248233
strategy:
@@ -303,7 +288,11 @@ jobs:
303288
echo ::set-output name=cover::false
304289
fi
305290
set -x
306-
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=5m -short -failfast $COVERAGE_FLAGS
291+
test_timeout=5m
292+
if [[ "${{ matrix.os }}" == windows* ]]; then
293+
test_timeout=10m
294+
fi
295+
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=$test_timeout -short -failfast $COVERAGE_FLAGS
307296
308297
- name: Upload DataDog Trace
309298
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
@@ -328,12 +317,6 @@ jobs:
328317

329318
test-go-postgres:
330319
name: "test/go/postgres"
331-
needs:
332-
- changes
333-
- pr-context
334-
if: >
335-
needs.changes.outputs.docs-only == 'false' &&
336-
!contains(needs.pr-context.outputs.skips, 'test/go/postgres')
337320
runs-on: ubuntu-latest
338321
# This timeout must be greater than the timeout set by `go test` in
339322
# `make test-postgres` to ensure we receive a trace of running
@@ -514,8 +497,6 @@ jobs:
514497

515498
test-js:
516499
name: "test/js"
517-
needs: changes
518-
if: needs.changes.outputs.docs-only == 'false'
519500
runs-on: ubuntu-latest
520501
timeout-minutes: 20
521502
steps:
@@ -571,8 +552,7 @@ jobs:
571552
name: "test/e2e/${{ matrix.os }}"
572553
needs:
573554
- changes
574-
- pr-context
575-
if: needs.changes.outputs.docs-only == 'false' && !contains(needs.pr-context.outputs.skips, 'test/e2e')
555+
if: needs.changes.outputs.docs-only == 'false'
576556
runs-on: ${{ matrix.os }}
577557
timeout-minutes: 20
578558
strategy:
@@ -646,3 +626,47 @@ jobs:
646626
DD_CATEGORY: e2e
647627
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
648628
run: go run scripts/datadog-cireport/main.go site/test-results/junit.xml
629+
chromatic:
630+
# REMARK: this is only used to build storybook and deploy it to Chromatic.
631+
runs-on: ubuntu-latest
632+
needs:
633+
- changes
634+
if: needs.changes.outputs.ts == 'true'
635+
steps:
636+
- uses: actions/checkout@v3
637+
with:
638+
# Required by Chromatic for build-over-build history, otherwise we
639+
# only get 1 commit on shallow checkout.
640+
fetch-depth: 0
641+
642+
- name: Install dependencies
643+
run: cd site && yarn
644+
645+
# This step is not meant for mainline because any detected changes to
646+
# storybook snapshots will require manual approval/review in order for
647+
# the check to pass. This is desired in PRs, but not in mainline.
648+
- name: Publish to Chromatic (non-mainline)
649+
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
650+
uses: chromaui/action@v1
651+
with:
652+
buildScriptName: "storybook:build"
653+
exitOnceUploaded: true
654+
# Chromatic states its fine to make this token public. See:
655+
# https://www.chromatic.com/docs/github-actions#forked-repositories
656+
projectToken: 695c25b6cb65
657+
workingDir: "./site"
658+
659+
# This is a separate step for mainline only that auto accepts and changes
660+
# instead of holding CI up. Since we squash/merge, this is defensive to
661+
# avoid the same changeset from requiring review once squashed into
662+
# main. Chromatic is supposed to be able to detect that we use squash
663+
# commits, but it's good to be defensive in case, otherwise CI remains
664+
# infinitely "in progress" in mainline unless we re-review each build.
665+
- name: Publish to Chromatic (mainline)
666+
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
667+
uses: chromaui/action@v1
668+
with:
669+
autoAcceptChanges: true
670+
buildScriptName: "storybook:build"
671+
projectToken: 695c25b6cb65
672+
workingDir: "./site"

.github/workflows/dogfood.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: dogfood
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
9+
paths:
10+
- "dogfood/**"
11+
pull_request:
12+
paths:
13+
- "dogfood/**"
14+
workflow_dispatch:
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Get branch name
21+
id: branch-name
22+
uses: tj-actions/branch-names@v5.4
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v2
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v2
29+
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v2
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
35+
36+
- name: Build and push
37+
uses: docker/build-push-action@v3
38+
with:
39+
context: "{{defaultContext}}:dogfood"
40+
push: true
41+
tags: "codercom/oss-dogfood:${{ steps.branch-name.outputs.current_branch }},codercom/oss-dogfood:latest"
42+
cache-from: type=registry,ref=codercom/oss-dogfood:latest
43+
cache-to: type=inline

0 commit comments

Comments
 (0)