Skip to content

Commit 5aad628

Browse files
committed
merged ci.yml
1 parent 41f54d3 commit 5aad628

File tree

1 file changed

+18
-35
lines changed

1 file changed

+18
-35
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, master ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, master ]
88

99
jobs:
10-
test:
11-
name: Build, Test, Vet
10+
build:
11+
name: Build, Test, Scan
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- name: Checkout
1615
uses: actions/checkout@v4
@@ -21,53 +20,37 @@ jobs:
2120
go-version-file: go.mod
2221
cache: true
2322

23+
- name: Download deps
24+
run: go mod download
25+
2426
- name: Go env
2527
run: go env
2628

2729
- name: Build
2830
run: go build ./...
2931

30-
- name: Test with coverage
31-
run: go test ./... -coverprofile=coverage.out
32-
3332
- name: Vet
3433
run: go vet ./...
3534

36-
- name: Upload coverage to Codecov
37-
uses: codecov/codecov-action@v4
38-
with:
39-
files: coverage.out
40-
token: ${{ secrets.CODECOV_TOKEN }}
41-
flags: unittests
42-
fail_ci_if_error: true
43-
name: CI
44-
on:
45-
push:
46-
branches: [ main, master ]
47-
pull_request:
48-
branches: [ main, master ]
35+
- name: Test (race + coverage)
36+
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
4937

50-
jobs:
51-
build:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: actions/setup-go@v5
56-
with:
57-
go-version: '1.22.x'
58-
- name: Download deps
59-
run: go mod download
60-
- name: Vet
61-
run: go vet ./...
62-
- name: Test (race)
63-
run: go test -race -cover ./...
6438
- name: Staticcheck
6539
run: |
6640
go install honnef.co/go/tools/cmd/staticcheck@latest
6741
$(go env GOPATH)/bin/staticcheck ./...
42+
6843
- name: Gosec
6944
run: |
7045
go install github.com/securego/gosec/v2/cmd/gosec@latest
7146
$(go env GOPATH)/bin/gosec ./...
7247
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v4
50+
with:
51+
files: coverage.out
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
flags: unittests
54+
fail_ci_if_error: true
55+
7356

0 commit comments

Comments
 (0)