-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.67 KB
/
main.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: test
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install system-level dependencies
run: |
# Install libpcsclite using apt package manager
sudo apt-get update
sudo apt-get install -y libpcsclite-dev
# Install other system-level dependencies if needed
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '>=1.21.3' # Use the Go version you require
- name: Run tests and generate coverage report
run: |
go test -race -coverpkg=./... -coverprofile=coverage.out ./...
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -parallel -coverprofile=coverage.out -service=github
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ github.token }}
GIT_BRANCH: ${{ github.head_ref }}
run: goveralls -parallel-finish -service=github