-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.11 KB
/
Copy pathci.yml
File metadata and controls
39 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: go.sum
- uses: actions/setup-node@v6
with:
node-version: "24"
package-manager-cache: false
- name: Generate license notices
run: go generate ./generator/license
- name: Test Go with race detector and coverage
run: go test -race -shuffle=on -count=1 -coverpkg=./... -coverprofile=coverage.out ./...
- name: Enforce coverage threshold
run: |
coverage="$(go tool cover -func=coverage.out | awk '/^total:/ {gsub(/%/, "", $3); print $3}')"
awk -v coverage="$coverage" 'BEGIN {
printf "Total coverage: %.1f%%\n", coverage
if (coverage + 0 < 60) exit 1
}'
- name: Vet Go packages
run: go vet ./...
- name: Test frontend helpers
run: node --test test_static/*.test.js