-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 879 Bytes
/
test.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
name: envtest
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
jobs:
unit-test:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"
steps:
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v3
-
name: UnitTest
run: |
sudo apt-get update
sudo apt-get install -y zfsutils-linux
sudo truncate -s 2G /disk.img
sudo zpool create tank /disk.img
sudo zfs create tank/envtest
LOCALBIN=$(pwd)/bin
ENVTEST=${LOCALBIN}/setup-envtest
ENVTEST_K8S_VERSION=1.25.0
GOBIN=${LOCALBIN} go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
sudo KUBEBUILDER_ASSETS="$(${ENVTEST} use ${ENVTEST_K8S_VERSION} --bin-dir ${LOCALBIN} -p path)" go test ./... -coverprofile cover.out