Skip to content

Commit 46a2113

Browse files
committed
Simplify and optimize CI/CD workflows
- Consolidate into 2 workflows: ci.yml (tests) and release.yml (deploy) - Build Docker images in parallel (amd64 + arm64 separate jobs) - Use per-arch caching for faster subsequent builds - Remove redundant build.yml and goreleaser.yml
1 parent 5dd0fd2 commit 46a2113

4 files changed

Lines changed: 163 additions & 358 deletions

File tree

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-frontend:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
cache-dependency-path: frontend/package-lock.json
20+
21+
- name: Install dependencies
22+
working-directory: ./frontend
23+
run: npm ci
24+
25+
- name: Lint
26+
working-directory: ./frontend
27+
run: npm run lint
28+
29+
- name: Type check
30+
working-directory: ./frontend
31+
run: npm run type-check
32+
33+
test-backend:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: actions/setup-go@v5
39+
with:
40+
go-version: '1.24'
41+
cache-dependency-path: backend/go.sum
42+
43+
- name: Test
44+
working-directory: ./backend
45+
run: go test -tags exclude_frontend ./...
46+
47+
- name: Vet
48+
working-directory: ./backend
49+
run: go vet -tags exclude_frontend ./...
50+
51+
build:
52+
runs-on: ubuntu-latest
53+
needs: [lint-frontend, test-backend]
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- uses: actions/setup-node@v4
58+
with:
59+
node-version: '20'
60+
cache: 'npm'
61+
cache-dependency-path: frontend/package-lock.json
62+
63+
- uses: actions/setup-go@v5
64+
with:
65+
go-version: '1.24'
66+
cache-dependency-path: backend/go.sum
67+
68+
- name: Build frontend
69+
working-directory: ./frontend
70+
run: npm ci && npm run build
71+
72+
- name: Build backend
73+
working-directory: ./backend
74+
run: go build -o tsflow ./main.go
75+
76+
- name: Verify binary
77+
run: ./backend/tsflow --help || true

0 commit comments

Comments
 (0)