-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (70 loc) · 2 KB
/
go-test.yml
File metadata and controls
75 lines (70 loc) · 2 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Test
permissions:
contents: read
on:
pull_request:
push:
branches:
- master
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
args: --verbose
only-new-issues: true
skip-cache: true
version: latest
build:
name: build test
needs:
- lint
strategy:
matrix:
go:
- "oldstable"
- "stable"
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go }}
check-latest: true
cache: true
- name: Build all packages
run: |
go build ./...
# empty tests for now, yet stronger check than just go build
go test ./...
test-complete:
# description: |
# Rendez-vous job: single required status check for branch protection,
# instead of requiring every matrix combination individually.
name: tests completed
needs: [lint, build]
runs-on: ubuntu-latest
steps:
-
name: Tests completed
run: |
echo "::notice title=Success::All tests passed"