-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (54 loc) · 1.3 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
55
56
57
on:
push:
tags:
- v*
branches:
- v*
- main
pull_request:
name: run tests
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: v1.52
test:
strategy:
matrix:
go-version: [ '1.20', '1.19', '1.18']
platform: [ 'ubuntu-latest' ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Install Go
if: success()
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: go test -v -race ./...
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
if: success()
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Checkout code
uses: actions/checkout@v2
- name: Calc coverage
run: |
go test -cover ./... -coverpkg=github.com/Flowpack/prunner/... -coverprofile=coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3