forked from astarte-platform/astarte-go
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.1 KB
/
build.yaml
File metadata and controls
43 lines (41 loc) · 1.1 KB
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
name: Build and Test
on:
# Run when pushing to stable branches
push:
branches:
- 'master'
- 'release-*'
# Run on branch/tag creation
create:
# Run on pull requests
pull_request:
jobs:
test:
strategy:
matrix:
go:
- 1.18.x
- 1.19.x
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- name: Build
run: go build -v ./...
- name: Test (with coverprofile)
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.18.x'
- name: Test (no coverprofile)
run: go test -v -race ./...
if: matrix.os != 'ubuntu-latest' || matrix.go != '1.18.x'
# Upload coverage report only in one case of the matrix
- name: Upload coverage report
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.18.x'