Skip to content

Commit a36653f

Browse files
committed
ci cd
1 parent b29fd51 commit a36653f

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/golang.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Go
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v6
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v6
15+
with:
16+
go-version: '1.25.7'
17+
18+
- name: Check Formatting
19+
run: |
20+
if [ -n "$(gofmt -l .)" ]; then
21+
echo "Go code is not formatted:"
22+
gofmt -d .
23+
exit 1
24+
fi
25+
working-directory: ./golang
26+
27+
- name: GolangCI-Lint
28+
uses: golangci/golangci-lint-action@v6
29+
with:
30+
version: latest
31+
working-directory: ./golang
32+
env:
33+
GOFLAGS: "-buildvcs=false"
34+
35+
- name: Run Gosec Security Scanner
36+
uses: securego/gosec@master
37+
with:
38+
args: ./golang/...
39+
env:
40+
GOTOOLCHAIN: auto
41+
42+
- name: Run govulncheck
43+
run: |
44+
go install golang.org/x/vuln/cmd/govulncheck@latest
45+
govulncheck ./...
46+
working-directory: ./golang
47+
48+
- name: Test
49+
run: go test -v -coverprofile=coverage.out ./...
50+
working-directory: ./golang

0 commit comments

Comments
 (0)