11name : CI
22
33on :
4+ push :
5+ branches : [ main ]
6+ paths :
7+ - ' cli/**'
8+ - ' .github/workflows/ci.yml'
49 pull_request :
510 branches : [ main ]
611 paths :
@@ -53,19 +58,19 @@ jobs:
5358 version : 9
5459
5560 - name : Install Mage
56- run : go install github.com/magefile/mage@latest
61+ run : go install github.com/magefile/mage@v1.15.0
5762
5863 - name : Install golangci-lint
59- run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
64+ run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
6065
6166 - name : Install staticcheck
62- run : go install honnef.co/go/tools/cmd/staticcheck@latest
67+ run : go install honnef.co/go/tools/cmd/staticcheck@v0.6.1
6368
6469 - name : Install gosec
65- run : go install github.com/securego/gosec/v2/cmd/gosec@latest
70+ run : go install github.com/securego/gosec/v2/cmd/gosec@v2.22.4
6671
6772 - name : Install govulncheck
68- run : go install golang.org/x/vuln/cmd/govulncheck@latest
73+ run : go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
6974
7075 - name : Install Azure Developer CLI (azd)
7176 run : curl -fsSL https://aka.ms/install-azd.sh | bash
7580 env :
7681 NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7782
83+ dashboard :
84+ name : Build Dashboard
85+ runs-on : ubuntu-latest
86+ timeout-minutes : 10
87+ steps :
88+ - name : Checkout code
89+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
90+
91+ - name : Set up Node.js
92+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
93+ with :
94+ node-version : ' 22'
95+
96+ - name : Install pnpm
97+ uses : pnpm/action-setup@5b4374b04084dc1f9032b52464284b769ac5059e # v4
98+ with :
99+ version : 9
100+
101+ - name : Build dashboard
102+ working-directory : cli/dashboard
103+ run : |
104+ pnpm install
105+ pnpm run build
106+
107+ - name : Upload dashboard dist
108+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
109+ with :
110+ name : dashboard-dist
111+ path : cli/dashboard/dist/
112+ retention-days : 1
113+
78114 test :
79115 name : Test
80116 runs-on : ${{ matrix.os }}
117+ needs : [dashboard]
81118 timeout-minutes : 30
82119 strategy :
83120 matrix :
@@ -94,22 +131,11 @@ jobs:
94131 cache : true
95132 cache-dependency-path : cli/go.sum
96133
97- - name : Set up Node.js
98- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
134+ - name : Download dashboard dist
135+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
99136 with :
100- node-version : ' 22'
101-
102- - name : Install pnpm
103- uses : pnpm/action-setup@5b4374b04084dc1f9032b52464284b769ac5059e # v4
104- with :
105- version : 9
106-
107- - name : Build dashboard
108- run : |
109- cd dashboard
110- pnpm install
111- pnpm run build
112- cd ..
137+ name : dashboard-dist
138+ path : cli/dashboard/dist/
113139
114140 - name : Install Aspire CLI
115141 shell : pwsh
@@ -138,12 +164,9 @@ jobs:
138164 mkdir -p ../coverage
139165 # Exclude tests/test-tool (it's a standalone main package with no tests)
140166 PACKAGES=$(go list ./... | grep -v '/tests/test-tool')
141- # Race detector not supported on macOS without additional setup
142- if [ "${{ matrix.os }}" = "macos-latest" ]; then
143- go test -short -v -coverprofile=../coverage/coverage.out $PACKAGES
144- else
145- go test -short -v -race -coverprofile=../coverage/coverage.out $PACKAGES
146- fi
167+ go test -short -v -race -coverprofile=../coverage/coverage.out $PACKAGES
168+ env :
169+ CGO_ENABLED : ' 1'
147170
148171 - name : Upload coverage to Codecov
149172 if : github.repository == 'jongio/azd-app'
@@ -172,6 +195,7 @@ jobs:
172195 lint :
173196 name : Lint
174197 runs-on : ubuntu-latest
198+ needs : [dashboard]
175199 timeout-minutes : 30
176200
177201 steps :
@@ -185,33 +209,22 @@ jobs:
185209 cache : true
186210 cache-dependency-path : cli/go.sum
187211
188- - name : Set up Node.js
189- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
190- with :
191- node-version : ' 22'
192-
193- - name : Install pnpm
194- uses : pnpm/action-setup@5b4374b04084dc1f9032b52464284b769ac5059e # v4
212+ - name : Download dashboard dist
213+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
195214 with :
196- version : 9
197-
198- - name : Build dashboard assets
199- run : |
200- cd dashboard
201- pnpm install
202- pnpm run build
203- cd ..
215+ name : dashboard-dist
216+ path : cli/dashboard/dist/
204217
205218 - name : Install golangci-lint
206- run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
219+ run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
207220
208221 - name : Run golangci-lint
209222 run : golangci-lint run --timeout=5m
210223
211224 build :
212225 name : Build
213226 runs-on : ubuntu-latest
214- needs : [preflight, test, lint]
227+ needs : [preflight, test, lint, dashboard ]
215228 timeout-minutes : 30
216229
217230 defaults :
@@ -229,22 +242,11 @@ jobs:
229242 cache : true
230243 cache-dependency-path : cli/go.sum
231244
232- - name : Set up Node.js
233- uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
234- with :
235- node-version : ' 22'
236-
237- - name : Install pnpm
238- uses : pnpm/action-setup@5b4374b04084dc1f9032b52464284b769ac5059e # v4
245+ - name : Download dashboard dist
246+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
239247 with :
240- version : 9
241-
242- - name : Build dashboard
243- run : |
244- cd dashboard
245- pnpm install
246- pnpm run build
247- cd ..
248+ name : dashboard-dist
249+ path : cli/dashboard/dist/
248250
249251 - name : Build for multiple platforms
250252 run : |
@@ -262,7 +264,7 @@ jobs:
262264 integration :
263265 name : Integration Tests
264266 runs-on : ${{ matrix.os }}
265- needs : [preflight, test]
267+ needs : [preflight, test, dashboard ]
266268 timeout-minutes : 30
267269 strategy :
268270 fail-fast : false
@@ -280,6 +282,12 @@ jobs:
280282 cache : true
281283 cache-dependency-path : cli/go.sum
282284
285+ - name : Download dashboard dist
286+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
287+ with :
288+ name : dashboard-dist
289+ path : cli/dashboard/dist/
290+
283291 - name : Set up Node.js
284292 uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
285293 with :
@@ -336,13 +344,6 @@ jobs:
336344 done
337345 shell : bash
338346
339- - name : Build dashboard assets
340- run : |
341- cd dashboard
342- pnpm install
343- pnpm run build
344- cd ..
345-
346347 - name : Run port manager integration tests
347348 shell : bash
348349 timeout-minutes : 8
0 commit comments