Skip to content

Commit 3f41551

Browse files
ci: add govulncheck, job timeout, dependabot and preserve debug symbols in dev builds
- Add govulncheck step to CI pipeline for vulnerability scanning - Set 15-minute timeout on CI test job - Add dependabot config for weekly Go module and GitHub Actions updates - Split LD_FLAGS so dev builds retain debug symbols while release builds remain stripped with -s -w
1 parent 491a2ac commit 3f41551

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
go-dependencies:
9+
patterns:
10+
- "*"
11+
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: weekly
16+
groups:
17+
actions:
18+
patterns:
19+
- "*"

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
jobs:
1313
test:
1414
runs-on: self-hosted
15+
timeout-minutes: 15
1516
container:
1617
image: golang:1.26.4
1718
steps:
@@ -23,6 +24,11 @@ jobs:
2324
- name: Vet
2425
run: go vet ./...
2526

27+
- name: Govulncheck
28+
run: |
29+
go install golang.org/x/vuln/cmd/govulncheck@latest
30+
govulncheck ./...
31+
2632
- name: Test
2733
run: go test -v -race -count=1 ./...
2834

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
1414

1515
VERSION ?= $(if $(GIT_TAG),$(GIT_TAG),v0.0.0-$(GIT_COMMIT))
1616

17-
LD_FLAGS := -s -w \
17+
LD_FLAGS := \
1818
-X main.Version=$(VERSION) \
1919
-X main.GitCommit=$(GIT_COMMIT) \
2020
-X main.BuildDate=$(BUILD_DATE)
2121

22+
RELEASE_LD_FLAGS := -s -w $(LD_FLAGS)
23+
2224
define BUILD_PLATFORM
23-
GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build -ldflags "$(LD_FLAGS)" \
25+
GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build -ldflags "$(RELEASE_LD_FLAGS)" \
2426
-o $(DIST_DIR)/$(BINARY_NAME)-$(1)-$(2)$(3) \
2527
./cmd/opencodereview
2628
endef

0 commit comments

Comments
 (0)