File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Go Tests
2+
3+ on :
4+ pull_request :
5+ branches : [main]
6+ paths :
7+ - " backend/**"
8+ - " .github/workflows/go-test.yml"
9+
10+ jobs :
11+ test :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+
18+ - name : Set up Go
19+ uses : actions/setup-go@v4
20+ with :
21+ go-version : " 1.23.4"
22+ cache-dependency-path : backend/go.sum
23+
24+ - name : Cache Go modules
25+ uses : actions/cache@v3
26+ with :
27+ path : |
28+ ~/.cache/go-build
29+ ~/go/pkg/mod
30+ key : ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}
31+ restore-keys : |
32+ ${{ runner.os }}-go-
33+
34+ - name : Download dependencies
35+ working-directory : ./backend
36+ run : go mod download
37+
38+ - name : Verify dependencies
39+ working-directory : ./backend
40+ run : go mod verify
41+
42+ - name : Run go vet
43+ working-directory : ./backend
44+ run : go vet ./...
45+
46+ - name : Run tests
47+ working-directory : ./backend
48+ run : go test -race -coverprofile=coverage.out ./...
49+
50+ - name : Upload coverage reports to Codecov
51+ uses : codecov/codecov-action@v5
52+ with :
53+ token : ${{ secrets.CODECOV_TOKEN }}
You can’t perform that action at this time.
0 commit comments