generated from devnw/oss-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.13 KB
/
build.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
name: Build & Test
# this is triggered on push to the repository
on: [push, pull_request]
jobs:
build:
name: "Build"
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v4
- name: Build
run: go build ./...
test:
name: "Unit Tests"
needs: [build]
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Test
run: go test -failfast ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Push Coverage to codecov.io
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt