@@ -30,11 +30,28 @@ concurrency:
30
30
cancel-in-progress : ${{ github.event_name == 'pull_request' }}
31
31
32
32
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
+
33
49
changes :
34
50
runs-on : ubuntu-latest
35
51
outputs :
36
52
docs-only : ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
37
53
sh : ${{ steps.filter.outputs.sh }}
54
+ ts : ${{ steps.filter.outputs.ts }}
38
55
steps :
39
56
- uses : actions/checkout@v3
40
57
# For pull requests it's not necessary to checkout the code
50
67
# - '.github/**'
51
68
sh:
52
69
- "**.sh"
70
+ ts:
71
+ - "**.tsx?"
72
+ - "**.jsx?"
73
+ - "**.lock"
74
+ - "**.json"
53
75
- id : debug
54
76
run : |
55
77
echo "${{ toJSON(steps.filter )}}"
@@ -269,7 +291,11 @@ jobs:
269
291
echo ::set-output name=cover::false
270
292
fi
271
293
set -x
272
- gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=5m -short -failfast $COVERAGE_FLAGS
294
+ test_timeout=5m
295
+ if [[ "${{ matrix.os }}" == windows* ]]; then
296
+ test_timeout=10m
297
+ fi
298
+ gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=$test_timeout -short -failfast $COVERAGE_FLAGS
273
299
274
300
- name : Upload DataDog Trace
275
301
if : github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
@@ -603,3 +629,47 @@ jobs:
603
629
DD_CATEGORY : e2e
604
630
GIT_COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
605
631
run : go run scripts/datadog-cireport/main.go site/test-results/junit.xml
632
+ chromatic :
633
+ # REMARK: this is only used to build storybook and deploy it to Chromatic.
634
+ runs-on : ubuntu-latest
635
+ needs :
636
+ - changes
637
+ if : needs.changes.outputs.ts == 'true'
638
+ steps :
639
+ - uses : actions/checkout@v3
640
+ with :
641
+ # Required by Chromatic for build-over-build history, otherwise we
642
+ # only get 1 commit on shallow checkout.
643
+ fetch-depth : 0
644
+
645
+ - name : Install dependencies
646
+ run : cd site && yarn
647
+
648
+ # This step is not meant for mainline because any detected changes to
649
+ # storybook snapshots will require manual approval/review in order for
650
+ # the check to pass. This is desired in PRs, but not in mainline.
651
+ - name : Publish to Chromatic (non-mainline)
652
+ if : github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
653
+ uses : chromaui/action@v1
654
+ with :
655
+ buildScriptName : " storybook:build"
656
+ exitOnceUploaded : true
657
+ # Chromatic states its fine to make this token public. See:
658
+ # https://www.chromatic.com/docs/github-actions#forked-repositories
659
+ projectToken : 695c25b6cb65
660
+ workingDir : " ./site"
661
+
662
+ # This is a separate step for mainline only that auto accepts and changes
663
+ # instead of holding CI up. Since we squash/merge, this is defensive to
664
+ # avoid the same changeset from requiring review once squashed into
665
+ # main. Chromatic is supposed to be able to detect that we use squash
666
+ # commits, but it's good to be defensive in case, otherwise CI remains
667
+ # infinitely "in progress" in mainline unless we re-review each build.
668
+ - name : Publish to Chromatic (mainline)
669
+ if : github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
670
+ uses : chromaui/action@v1
671
+ with :
672
+ autoAcceptChanges : true
673
+ buildScriptName : " storybook:build"
674
+ projectToken : 695c25b6cb65
675
+ workingDir : " ./site"
0 commit comments