1+ name : backend-pr-ci
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - " backend/**"
7+ - " .github/workflows/backend-pr-ci.yml"
8+ workflow_dispatch :
9+
10+ permissions :
11+ contents : read
12+
13+ concurrency :
14+ group : backend-pr-ci-${{ github.event.pull_request.number || github.ref }}
15+ cancel-in-progress : true
16+
17+ env :
18+ GO_VERSION : " 1.24"
19+
20+ jobs :
21+ lint :
22+ name : Lint
23+ runs-on : ubuntu-latest
24+ timeout-minutes : 10
25+
26+ defaults :
27+ run :
28+ working-directory : backend
29+
30+ steps :
31+ - name : Checkout repository
32+ uses : actions/checkout@v4
33+ with :
34+ fetch-depth : 1
35+
36+ - name : Setup Go
37+ uses : actions/setup-go@v5
38+ with :
39+ go-version : ${{ env.GO_VERSION }}
40+ cache-dependency-path : backend/go.sum
41+
42+ - name : Install golangci-lint
43+ run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
44+
45+ - name : Run golangci-lint
46+ run : golangci-lint run --timeout=5m
47+
48+ build :
49+ name : Build
50+ runs-on : ubuntu-latest
51+ timeout-minutes : 10
52+
53+ defaults :
54+ run :
55+ working-directory : backend
56+
57+ steps :
58+ - name : Checkout repository
59+ uses : actions/checkout@v4
60+ with :
61+ fetch-depth : 1
62+
63+ - name : Setup Go
64+ uses : actions/setup-go@v5
65+ with :
66+ go-version : ${{ env.GO_VERSION }}
67+ cache-dependency-path : backend/go.sum
68+
69+ - name : Build WASM
70+ run : GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o github.wasm .
71+
72+ test :
73+ name : Tests
74+ runs-on : ubuntu-latest
75+ timeout-minutes : 15
76+
77+ defaults :
78+ run :
79+ working-directory : backend
80+
81+ steps :
82+ - name : Checkout repository
83+ uses : actions/checkout@v4
84+ with :
85+ fetch-depth : 1
86+
87+ - name : Setup Go
88+ uses : actions/setup-go@v5
89+ with :
90+ go-version : ${{ env.GO_VERSION }}
91+ cache-dependency-path : backend/go.sum
92+
93+ - name : Run tests (race detector)
94+ run : go test -race -timeout 60s -coverprofile=coverage.out $(go list ./...)
95+
96+ - name : Upload coverage report
97+ uses : actions/upload-artifact@v4
98+ with :
99+ name : coverage-report
100+ path : backend/coverage.out
101+ retention-days : 7
0 commit comments