-
Notifications
You must be signed in to change notification settings - Fork 314
41 lines (39 loc) · 964 Bytes
/
api-test.yaml
File metadata and controls
41 lines (39 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: go-api-test
on:
push:
branches:
- main
- dev
paths:
- 'src/server/api/go/**'
- '.github/workflows/api-test.yaml'
pull_request:
branches:
- main
- dev
paths:
- 'src/server/api/go/**'
- '.github/workflows/api-test.yaml'
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/server/api/go
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: src/server/api/go/go.mod
cache: true
- run: go mod tidy
- name: Run tests with coverage
run: go test -v -timeout 30m -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: go-api-coverage
path: src/server/api/go/coverage.out