|
1 | 1 | name: tests
|
2 |
| -on: |
| 2 | +on: |
3 | 3 | push:
|
4 | 4 | pull_request:
|
5 | 5 |
|
6 | 6 | jobs:
|
7 |
| - |
8 | 7 | test:
|
9 |
| - name: run tests with go 1.16 and code coverage |
| 8 | + name: run tests with code coverage |
10 | 9 | runs-on: ubuntu-latest
|
11 |
| - steps: |
12 |
| - - name: Set up Go 1.16 |
13 |
| - uses: actions/setup-go@v1 |
14 |
| - with: |
15 |
| - go-version: 1.16 |
16 |
| - id: go |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + go: |
| 13 | + - "1.16" |
| 14 | + - "1.15" |
| 15 | + - "1.14" |
| 16 | + - "1.13" |
17 | 17 |
|
18 |
| - - name: Check out code into the Go module directory |
19 |
| - uses: actions/checkout@v1 |
20 |
| - |
21 |
| - - name: go test |
22 |
| - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... |
23 |
| - |
24 |
| - - name: Upload coverage to Codecov |
25 |
| - uses: codecov/codecov-action@v1 |
26 |
| - with: |
27 |
| - file: ./coverage.txt |
28 |
| - |
29 |
| - test-v115: |
30 |
| - name: run tests with go 1.15 |
31 |
| - runs-on: ubuntu-latest |
32 | 18 | steps:
|
33 |
| - - name: Set up Go 1.15 |
| 19 | + - name: Set up Go ${{ matrix.go }} |
34 | 20 | uses: actions/setup-go@v1
|
35 | 21 | with:
|
36 |
| - go-version: 1.15 |
| 22 | + go-version: ${{ matrix.go }} |
37 | 23 | id: go
|
38 | 24 |
|
39 | 25 | - name: Check out code into the Go module directory
|
|
42 | 28 | - name: go test
|
43 | 29 | run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
|
44 | 30 |
|
45 |
| - test-v114: |
46 |
| - name: run tests with go 1.14 |
47 |
| - runs-on: ubuntu-latest |
48 |
| - steps: |
49 |
| - - name: Set up Go 1.14 |
50 |
| - uses: actions/setup-go@v1 |
51 |
| - with: |
52 |
| - go-version: 1.14 |
53 |
| - id: go |
54 |
| - |
55 |
| - - name: Check out code into the Go module directory |
56 |
| - uses: actions/checkout@v1 |
57 |
| - |
58 |
| - - name: go test |
59 |
| - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... |
60 |
| - |
61 |
| - test-v113: |
62 |
| - name: run tests with go 1.13 |
63 |
| - runs-on: ubuntu-latest |
64 |
| - steps: |
65 |
| - - name: Set up Go 1.13 |
66 |
| - uses: actions/setup-go@v1 |
| 31 | + - name: Upload coverage to Codecov |
| 32 | + uses: codecov/codecov-action@v1 |
| 33 | + if: matrix.go == '1.16' |
67 | 34 | with:
|
68 |
| - go-version: 1.13 |
69 |
| - id: go |
70 |
| - |
71 |
| - - name: Check out code into the Go module directory |
72 |
| - uses: actions/checkout@v1 |
73 |
| - |
74 |
| - - name: go test |
75 |
| - run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... |
| 35 | + file: ./coverage.txt |
0 commit comments