forked from markbates/goth
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 916 Bytes
/
ci.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
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
name: ci
jobs:
test:
strategy:
matrix:
go-version: [ 1.15.x, 1.16.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x ]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
if: matrix.os != 'windows-latest' && matrix.go-version == '1.19.x'
- name: Test
run: go test -race ./...