35
35
ts : ${{ steps.filter.outputs.ts }}
36
36
k8s : ${{ steps.filter.outputs.k8s }}
37
37
ci : ${{ steps.filter.outputs.ci }}
38
+ offlinedocs-only : ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
39
+ offlinedocs : ${{ steps.filter.outputs.offlinedocs }}
38
40
steps :
39
41
- name : Checkout
40
42
uses : actions/checkout@v3
85
87
ts:
86
88
- "site/**"
87
89
- "Makefile"
88
- - "offlinedocs/**"
89
90
k8s:
90
91
- "helm/**"
91
92
- "scripts/Dockerfile"
@@ -94,11 +95,16 @@ jobs:
94
95
ci:
95
96
- ".github/actions/**"
96
97
- ".github/workflows/ci.yaml"
98
+ offlinedocs:
99
+ - "offlinedocs/**"
100
+
97
101
- id : debug
98
102
run : |
99
103
echo "${{ toJSON(steps.filter )}}"
100
104
101
105
lint :
106
+ needs : changes
107
+ if : needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
102
108
runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
103
109
steps :
104
110
- name : Checkout
@@ -194,6 +200,8 @@ jobs:
194
200
run : ./scripts/check_unstaged.sh
195
201
196
202
fmt :
203
+ needs : changes
204
+ if : needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
197
205
runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
198
206
timeout-minutes : 5
199
207
steps :
@@ -590,9 +598,68 @@ jobs:
590
598
projectToken : 695c25b6cb65
591
599
workingDir : " ./site"
592
600
601
+ offlinedocs :
602
+ name : offlinedocs
603
+ needs : changes
604
+ runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
605
+ if : needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true'
606
+ steps :
607
+ - name : Checkout
608
+ uses : actions/checkout@v3
609
+ with :
610
+ fetch-depth : 0
611
+
612
+ - name : Setup Node
613
+ uses : ./.github/actions/setup-node
614
+ with :
615
+ directory : offlinedocs
616
+
617
+ - name : Setup Go
618
+ uses : ./.github/actions/setup-go
619
+
620
+ - name : Install go tools
621
+ run : |
622
+ go install github.com/golang/mock/mockgen@v1.6.0
623
+
624
+ - name : Setup sqlc
625
+ uses : sqlc-dev/setup-sqlc@v3
626
+ with :
627
+ sqlc-version : " 1.19.1"
628
+
629
+ - name : Install dependencies
630
+ run : |
631
+ cd offlinedocs
632
+ yarn
633
+ # Install prettier globally
634
+ prettier_version=$(jq -r '.devDependencies.prettier' < package.json)
635
+ yarn global add "prettier@${prettier_version}"
636
+
637
+ - name : Format
638
+ run : |
639
+ cd offlinedocs
640
+ yarn format:check
641
+
642
+ - name : Lint
643
+ run : |
644
+ cd offlinedocs
645
+ yarn lint
646
+
647
+ - name : Build
648
+ run : |
649
+ version="$(./scripts/version.sh)"
650
+ make -j build/coder_docs_"$version".tgz
651
+
593
652
required :
594
653
runs-on : ubuntu-latest
595
- needs : [fmt, lint, gen, test-go, test-go-pg, test-go-race, test-js]
654
+ needs :
655
+ - fmt
656
+ - lint
657
+ - gen
658
+ - test-go
659
+ - test-go-pg
660
+ - test-go-race
661
+ - test-js
662
+ - offlinedocs
596
663
# Allow this job to run even if the needed jobs fail, are skipped or
597
664
# cancelled.
598
665
if : always()
0 commit comments