forked from k0sproject/rig
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 1.75 KB
/
go.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
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
name: Go
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -v ./...
- name: Build windows
run: GOOS=windows GOARCH=amd64 go build -v ./...
- name: Test
run: go test -v ./...
integration:
strategy:
fail-fast: false
matrix:
image:
- quay.io/footloose/ubuntu18.04
- quay.io/footloose/centos7
# - quay.io/footloose/amazonlinux2 ( not recognized )
- quay.io/footloose/debian10
# - quay.io/footloose/fedora29 ( not recognized )
- alpine-3.18.iid
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: install test dependencies
run: |
sudo apt-get update
sudo apt-get install expect
- name: Prepare footloose image
id: prepare-footloose-image
env:
IMAGE: ${{ matrix.image }}
run: |
case "$IMAGE" in
*.iid)
make -C test "$IMAGE"
IMAGE="$(cat "test/$IMAGE")"
;;
esac
echo image="$IMAGE" >> $GITHUB_OUTPUT
- name: Run integration tests
env:
LINUX_IMAGE: ${{ steps.prepare-footloose-image.outputs.image }}
run: make -C test test