-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.19 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Test
on:
pull_request:
branches:
- master
- main
paths:
- "**.go"
- "**.mod"
- "**.sum"
jobs:
test-coverage-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: |
set +e -x
make test
TEST_FAILED=false
[[ $? == 0 ]] && echo "TEST_FAILED=true" >> $GITHUB_ENV
id: test_status
- name: Convert coverage to lcov
if: github.event_name == 'pull_request'
uses: jandelgado/gcov2lcov-action@v1
- name: Code Coverage Report
if: github.event_name == 'pull_request'
uses: vebr/jest-lcov-reporter@v0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: coverage.lcov
- name: Fail CI if test was failed
if: ${{ env.TEST_FAILED }}
run: |
false