forked from rogpeppe/go-internal
36 lines (34 loc) · 841 Bytes
/
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
on:
push:
branches:
- master
pull_request:
branches:
- '**'
name: Test
jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.14.x, 1.15.x, 1.16.0-beta1]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
stable: false
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: |
go test ./...
go test -race ./...
- name: Tidy
if: matrix.os == 'ubuntu-latest' # no need to do this everywhere
run: |
go mod tidy
test -z "$(gofmt -d .)" || (gofmt -d . && false)
test -z "$(git status --porcelain)" || (git status; git diff && false)