-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (84 loc) · 2.76 KB
/
Copy pathci.yml
File metadata and controls
90 lines (84 loc) · 2.76 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: gofmt
run: test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; }
- name: vet
run: go vet ./...
- name: test
run: go test -race ./...
- name: deployment diagnostics
run: go run ./cmd/geoverse -doctor -format json -config config.example.yaml
- name: build
run: CGO_ENABLED=0 go build -trimpath ./cmd/geoverse
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: docker build
run: docker build -t geoverse-map-server:ci .
- name: read-only container diagnostics
run: >-
docker run --rm --read-only
-v "$PWD:/work:ro" -w /work
geoverse-map-server:ci
-doctor -format json -config config.example.yaml
# Supply-chain visibility. Deliberately observe-only for now: this is the
# first time these tools run against this repo, so the job reports what
# it finds without failing the build. See DEPLOY.md "供应链: SBOM / 许可
# 证 / 漏洞扫描" for the review cadence and how a future failure
# threshold would be introduced once a baseline exists.
supply-chain:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: docker build
run: docker build -t geoverse-map-server:ci .
- name: SBOM (SPDX JSON via syft)
run: >-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock
anchore/syft:latest docker:geoverse-map-server:ci -o spdx-json
> sbom.spdx.json
- name: vulnerability scan (trivy, report-only)
run: >-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock
aquasec/trivy:latest image --format json
--severity CRITICAL,HIGH,MEDIUM geoverse-map-server:ci
> trivy-report.json
- uses: actions/upload-artifact@v4
with:
name: supply-chain-reports
path: |
sbom.spdx.json
trivy-report.json
retention-days: 90
licenses:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: go-licenses report (observe-only)
run: |
go install github.com/google/go-licenses@latest
go-licenses report ./cmd/geoverse > licenses.csv || true
- uses: actions/upload-artifact@v4
with:
name: third-party-licenses
path: licenses.csv
retention-days: 90