-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (38 loc) · 1.24 KB
/
Copy pathtest.yml
File metadata and controls
48 lines (38 loc) · 1.24 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
name: Run Tests
on:
push:
branches:
- master
pull_request:
env:
GO_VERSION: '1.16'
# list of available versions: https://storage.googleapis.com/kubebuilder-tools
# TODO: 1.21.2 does not shut down properly with controller-runtime 0.9.2
KUBEBUILDER_TOOLS_VERSION: '1.20.2'
jobs:
test:
name: Test
runs-on: ubuntu-18.04
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Add envtest binaries
run: |
curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-${{env.KUBEBUILDER_TOOLS_VERSION}}-linux-amd64.tar.gz"
sudo mkdir -p /usr/local/kubebuilder
sudo tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz
- name: Cache envtest binaries
uses: actions/cache@v2.1.6
with:
path: /usr/local/kubebuilder
key: ${{ runner.os }}-kubebuilder-${{env.KUBEBUILDER_TOOLS_VERSION}}
restore-keys: ${{ runner.os }}-kubebuilder
- name: Install make
run: sudo apt-get install -y make
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Test
run: make test