forked from willnorris/imageproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.39 KB
/
tests.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
on: [push, pull_request]
name: tests
env:
GO111MODULE: on
jobs:
test:
strategy:
matrix:
go-version:
# support the two most recent major go versions
- 1.x
- 1.15.x
platform: [ubuntu-latest, windows-latest]
include:
# minimum go version that works. This is not necessarily supported in
# any way, and will be bumped up without notice as needed. But it at
# least lets us know what go version should work.
- go-version: 1.11
platform: ubuntu-latest
# only update test coverage stats with most recent go version on linux
- go-version: 1.x
platform: ubuntu-latest
update-coverage: true
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- run: go version
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Run go test
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./...
- name: Upload coverage to Codecov
if: ${{ matrix.update-coverage }}
uses: codecov/codecov-action@v1
timeout-minutes: 2