-
Notifications
You must be signed in to change notification settings - Fork 362
39 lines (37 loc) · 998 Bytes
/
unit-test.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
name: Test and coverage
on:
push:
branches: "*"
workflow_dispatch: {}
pull_request:
branches: "*"
paths-ignore:
- 'docs/**'
- '*.md'
- '*.yml'
- '.github'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Set up Go 1.17
uses: actions/setup-go@v3
with:
go-version: '1.17'
- name: Run unit test and generate coverage
run: go test -v -race -coverprofile=coverage.out -covermode=atomic `go list ./... | grep -v /test`
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out
flags: unit-tests
name: codecov-umbrella