-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (39 loc) · 973 Bytes
/
build.yml
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
42
43
44
45
name: Build
on:
push:
branches:
- '**'
pull_request:
branches:
- main
- 'v[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.22.x ]
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Check go.mod
run: |
go mod tidy
git diff --exit-code
- name: Test
run: |
go test -race -tags=ci ./... -coverprofile=coverage.out -covermode=atomic
grep -v -E -f .covignore coverage.out > coverage.filtered.out
mv coverage.filtered.out coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
run: |
cd cmd/backup
go build -tags=ci .