-
Notifications
You must be signed in to change notification settings - Fork 133
43 lines (41 loc) · 1.16 KB
/
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
37
38
39
40
41
42
43
name: test
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
test:
permissions:
contents: read # for actions/checkout to fetch code
timeout-minutes: 10
strategy:
matrix:
# test against the "oldest" supported version and the current version
# of go. Go 1.17 is kept in this matrix as it is the minimum version
# specified in go.mod, and maintaining compatibility with go 1.17 is
# currently not much of a burden. Most projects using this module are
# using newer versions than that, so we can drop the old version if
# it becomes too much of a burden.
go-version: [1.17.x, stable]
os: [ubuntu-20.04, ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: Test
run: go test -exec "sudo -n" -v ./...