-
Notifications
You must be signed in to change notification settings - Fork 63
48 lines (42 loc) · 1.29 KB
/
test.yaml
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
name: Run Tests
on: [push, pull_request]
jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
goVer: ['1.19', '1.20']
# Defines the platform for each test run.
runs-on: ${{ matrix.os }}
steps:
# Checks out our code locally so we can work with the files.
- name: Checkout code
uses: actions/checkout@v3
# The steps that will be run through for each version and platform combination.
- name: Set up Go ${{ matrix.goVer }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goVer }}
cache: true
# Runs go test ./...
- name: Test
run: go test -v -short ./...
lint:
runs-on: ubuntu-latest
steps:
# Checks out our code locally so we can work with the files.
- name: Checkout code
uses: actions/checkout@v3
# Installs go using a single version.
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
# Runs the default linters provided by golangci-lint plus golint and godot.
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: v1.52
args: --enable=golint --enable=godot --timeout=3m