-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (24 loc) · 807 Bytes
/
Copy pathtest.yml
File metadata and controls
29 lines (24 loc) · 807 Bytes
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
name: Tests
on:
push:
pull_request:
jobs:
test:
name: Run on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install setup-envtest
run: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
- name: Running Tests
run: |
go mod tidy
K8S_VERSION=$(go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $3}')
KUBEBUILDER_ASSETS="$($(go env GOPATH)/bin/setup-envtest use ${K8S_VERSION} --bin-dir $(pwd)/bin/k8s -p path)"
export KUBEBUILDER_ASSETS
go test $(go list ./... | grep -v /e2e) -coverprofile cover.out