Skip to content

Commit 11a574c

Browse files
committed
ci: add CI workflow for Go and Web UI
This adds a GitHub Actions workflow that: 1. Builds the Web UI (using Node.js 24 LTS). 2. Performs a Go format check. 3. Runs Go lint (vet) and fast tests. 4. Verifies the Go build. 5. Runs golangci-lint on new issues.
1 parent dd5581f commit 11a574c

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: CI
16+
17+
on:
18+
push:
19+
branches: [ main ]
20+
pull_request:
21+
branches: [ main ]
22+
23+
jobs:
24+
build-and-test:
25+
name: Build & Test
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v6
30+
31+
- name: Setup Go
32+
uses: actions/setup-go@v6
33+
with:
34+
go-version-file: 'go.mod'
35+
cache: true
36+
37+
- name: Setup Node
38+
uses: actions/setup-node@v6
39+
with:
40+
node-version: '24' # Node.js 24 (LTS)
41+
cache: 'npm'
42+
cache-dependency-path: 'web/package-lock.json'
43+
44+
- name: Build Web UI
45+
working-directory: ./web
46+
run: |
47+
npm ci
48+
npm run build
49+
50+
- name: Verify Web Build
51+
run: ls -la web/dist
52+
53+
- name: Format Check
54+
run: |
55+
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
56+
echo "Files need formatting. Run 'go fmt ./...'"
57+
gofmt -d .
58+
exit 1
59+
fi
60+
61+
- name: Vet Code
62+
run: make lint
63+
64+
- name: Run Tests
65+
run: make test-fast
66+
67+
- name: Build Binary
68+
run: make build
69+
70+
lint:
71+
name: golangci-lint
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v6
76+
77+
- name: Setup Go
78+
uses: actions/setup-go@v6
79+
with:
80+
go-version-file: 'go.mod'
81+
cache: true
82+
83+
- name: golangci-lint
84+
uses: golangci/golangci-lint-action@v9
85+
with:
86+
# Only run on changes in PRs to avoid noise from existing issues
87+
only-new-issues: true

0 commit comments

Comments
 (0)