41 lines (38 loc) · 962 Bytes
/
vagrant.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
name: vagrant
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
image:
- debian6
runs-on: macos-12
steps:
- name: checkout
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.18'
- name: test
run: |
cp -f .github/workflows/Vagrantfile.${{ matrix.image }} 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