-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (34 loc) · 938 Bytes
/
test.yml
File metadata and controls
40 lines (34 loc) · 938 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
name: Unit Tests
on:
push:
pull_request:
jobs:
test:
name: Run on Ubuntu
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Clone the code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Running Tests with Coverage
run: |
go mod tidy
make test
- name: check test coverage
if: github.ref == 'refs/heads/main'
uses: vladopajic/go-test-coverage@v2
with:
config: ./.github/.testcoverage.yml
git-branch: badges
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
- name: Check test coverage
if: github.ref != 'refs/heads/main'
uses: vladopajic/go-test-coverage@v2
with:
config: ./.github/.testcoverage.yml