-
Notifications
You must be signed in to change notification settings - Fork 25
44 lines (32 loc) · 1.14 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
name: Go
on: [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: |
go mod download
curl -L -o /tmp/kubebuilder https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.11.1/kubebuilder_linux_amd64
sudo mv /tmp/kubebuilder /usr/local/kubebuilder
cd coredns-plugin && go get -v -t -d ./...
- name: Build
run: go build -v .
- name: Build CoreDNS plugin
run: cd coredns-plugin && go build -o coredns ./cmd
- name: Test
run: |
# make sure Go binaries are in PATH
export PATH=${PATH}:$(go env GOPATH)/bin
# install K8s testing components (apiserver etc)
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
# populate KUBEBUILDER_ASSETS env var
KUBEBUILDER_ASSETS=$(setup-envtest use -p path) go test ./... -ginkgo.v -v