forked from fsnotify/fsnotify
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (148 loc) · 4.06 KB
/
test.yml
File metadata and controls
162 lines (148 loc) · 4.06 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: 'test'
on:
push:
paths: ['**.go', 'go.mod', '.github/workflows/*']
jobs:
# Test Windows and Linux with the latest Go version and the oldest we support.
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
go:
- '1.16'
- '1.19'
runs-on: ${{ matrix.os }}
steps:
- name: setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v3
- name: test
run: |
go test -race ./...
# Test only the latest Go version on macOS; we use the macOS builders for BSD
# and illumos, and GitHub doesn't allow many of them to run concurrently. If
# it works on Windows and Linux with Go 1.16, then it probably does on macOS
# too.
testMacOS:
name: test
strategy:
fail-fast: false
matrix:
os:
- macos-11
- macos-12
go:
- '1.19'
runs-on: ${{ matrix.os }}
steps:
- name: setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: checkout
uses: actions/checkout@v3
- name: test
run: |
go test -race ./...
# FreeBSD
testFreeBSD:
runs-on: macos-12
name: test (freebsd, 1.18)
steps:
- uses: actions/checkout@v3
- name: test (freebsd, 1.18)
id: test
uses: vmactions/freebsd-vm@v0.2.0
with:
usesh: true
prepare: pkg install -y go
run: |
pw user add -n action -m
su action -c 'go test -race ./...'
# OpenBSD; no -race as the VM doesn't include the comp set.
#
# TODO: should probably add this, but on my local machine the tests time out
# with -race as the waits aren't long enough (OpenBSD is kind of slow),
# so should probably look into that first. Go 1.19 is supposed to have a
# much faster race detector, so maybe waiting until we have that is
# enough.
testOpenBSD:
runs-on: macos-12
name: test (openbsd, 1.17)
steps:
- uses: actions/checkout@v3
- name: test (openbsd, 1.17)
id: test
uses: vmactions/openbsd-vm@v0.0.6
with:
prepare: pkg_add go
run: |
useradd -mG wheel action
su action -c 'go test ./...'
# NetBSD
testNetBSD:
runs-on: macos-12
name: test (netbsd, 1.18)
steps:
- uses: actions/checkout@v3
- name: test (netbsd, 1.18)
id: test
uses: vmactions/netbsd-vm@v0.0.4
with:
prepare: pkg_add go
# TODO: no -race for the same reason as OpenBSD (the timing; it does run).
run: |
useradd -mG wheel action
su action -c 'go118 test ./...'
# illumos
testillumos:
runs-on: macos-12
name: test (illumos, 1.17)
steps:
- uses: actions/checkout@v2
- name: test (illumos, 1.17)
id: test
uses: papertigers/illumos-vm@r38
with:
prepare: |
pkg install go-117
run: |
/opt/ooce/go-1.17/bin/go test ./...
# Older Debian 6, for old Linux kernels.
testDebian6:
runs-on: macos-12
name: test (debian6, 1.19)
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: setup Go
uses: actions/setup-go@v3
with:
go-version: '1.19'
- name: test (debian6, 1.19)
id: test
run: |
cp -f .github/workflows/Vagrantfile.debian6 Vagrantfile
export GOOS=linux
export GOARCH=amd64
for p in $(go list ./...); do
go test -c -o ${p//\//-}.test $p
done
vagrant up
for t in *.test; do
vagrant ssh -c "/vagrant/$t"
done