Skip to content

Commit 443acaa

Browse files
authored
Merge pull request #12 from upsaurav12/ci
fix: ci.yaml
2 parents 1c9326d + 9a1f125 commit 443acaa

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Go
1+
name: Go CI
22

33
on:
44
push:
@@ -7,19 +7,36 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build-and-test:
10+
ci:
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v4
1516

1617
- name: Set up Go
1718
uses: actions/setup-go@v5
1819
with:
19-
go-version: '1.22' # Adjust to match your go.mod
20+
go-version-file: go.mod
21+
cache: true
2022

21-
- name: Install dependencies
22-
run: go mod tidy
23+
# Ensures go.mod/go.sum are clean
24+
- name: Verify dependencies
25+
run: |
26+
go mod tidy
27+
git diff --exit-code
2328
2429
- name: Run tests
25-
run: go test ./...
30+
run: |
31+
go test ./... -race -count=1
32+
33+
- name: Run tests with coverage
34+
run: |
35+
go test ./... -coverprofile=coverage.out
36+
go tool cover -func=coverage.out
37+
38+
- name: Lint
39+
uses: golangci/golangci-lint-action@v6
40+
with:
41+
version: latest
42+
args: --timeout=5m

0 commit comments

Comments
 (0)