-
-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (58 loc) · 1.72 KB
/
test-unit.yaml
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
63
64
65
66
67
---
name: unit-test
on:
push:
branches:
- master
env:
GO111MODULE: "on"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.find-go-version.outputs.go-version }}
go-latest-version: ${{ steps.find-go-version.outputs.go-latest-version }}
go-supported-versions: ${{ steps.find-go-version.outputs.go-supported-versions }}
steps:
- name: Checkout code
uses: nhatthm/gh-actions/checkout@master
- id: find-go-version
name: Find Go version
uses: nhatthm/gh-actions/find-go-version@master
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go-version: ${{ fromJson(needs.setup.outputs.go-supported-versions) }}
arch: [ "386", amd64 ]
exclude:
- os: macos-latest
arch: "386"
runs-on: ${{ matrix.os }}
needs: [setup]
env:
GO_LATEST_VERSION: ${{ needs.setup.outputs.go-latest-version }}
steps:
- name: Checkout code
uses: nhatthm/gh-actions/checkout@master
- name: Install Go
uses: nhatthm/gh-actions/setup-go@master
with:
go-version: ${{ matrix.go-version }}
- name: Test
id: test
env:
GOARCH: ${{ matrix.arch }}
run: |
make test-unit
- name: Upload code coverage (unit)
if: ${{ matrix.go-version == env.GO_LATEST_VERSION }}
uses: nhatthm/gh-actions/codecov@master
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.coverprofile
flags: unittests-${{ runner.os }}-${{ runner.arch }}