Skip to content

Commit 9e820df

Browse files
AnnatarHeclaude
andcommitted
ci: add PR check workflow
- Add GitHub Actions workflow for pull request checks - Setup Go 1.24 environment - Run tests with coverage collection - Upload coverage to Codecov - Cache Go modules for faster builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fa1c8bb commit 9e820df

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/pr-check.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: "1.24"
29+
30+
- name: Cache Go modules
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/.cache/go-build
35+
~/go/pkg/mod
36+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-go-
39+
40+
- name: Download dependencies
41+
run: go mod download
42+
43+
- name: Generate mocks
44+
run: |
45+
go install github.com/vektra/mockery/v3@v3.5.0
46+
mockery
47+
48+
- name: Run tests with coverage
49+
run: go test -timeout 3m -coverprofile=coverage.txt -covermode=atomic ./...
50+
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v5.4.3
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
files: ./coverage.txt
56+
flags: unittests
57+
name: codecov-umbrella
58+
fail_ci_if_error: false

0 commit comments

Comments
 (0)