This repository was archived by the owner on May 24, 2023. It is now read-only.
File tree 2 files changed +14
-10
lines changed
2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 25
25
26
26
env :
27
27
DOCKER_BUILDKIT : 1
28
- GOLANG_VERSION : 1.16
29
28
30
29
jobs :
31
30
32
31
binary :
33
32
name : Build Binary
34
- runs-on : ubuntu-18 .04
33
+ runs-on : ubuntu-20 .04
35
34
steps :
36
35
- name : Checkout Repository
37
36
uses : actions/checkout@v2
37
+ - name : Determine Go version from go.mod
38
+ run : echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
39
+ - name : Setup Golang Environment
40
+ uses : actions/setup-go@v2
41
+ with :
42
+ go-version : ${{ env.GO_VERSION }}
38
43
- name : Build Binary
39
44
run : make binary
40
- env :
41
- GOFLAGS : ' -gcflags=-trimpath=${{ github.workspace }} -asmflags=-trimpath=${{ github.workspace }}'
42
45
- name : Cache Artifacts
43
46
44
47
with :
@@ -47,20 +50,20 @@ jobs:
47
50
48
51
unit-tests :
49
52
name : Unit Tests
50
- runs-on : ubuntu-18 .04
53
+ runs-on : ubuntu-20 .04
51
54
steps :
52
55
- name : Checkout Repository
53
56
uses : actions/checkout@v2
54
57
- name : Setup Golang Environment
55
58
uses : actions/setup-go@v2
56
59
with :
57
- go-version : ' ${{ env.GOLANG_VERSION }}'
60
+ go-version : ${{ env.GO_VERSION }}
58
61
- name : Run Tests
59
62
run : make test
60
63
61
64
build :
62
65
name : Build Image
63
- runs-on : ubuntu-18 .04
66
+ runs-on : ubuntu-20 .04
64
67
needs : [binary, unit-tests]
65
68
steps :
66
69
- name : Checkout Repository
93
96
94
97
release-docker :
95
98
name : Release Image
96
- runs-on : ubuntu-18 .04
99
+ runs-on : ubuntu-20 .04
97
100
needs : [build, unit-tests]
98
101
if :
99
102
github.repository == 'nginxinc/nginx-ingress-operator' &&
@@ -138,7 +141,7 @@ jobs:
138
141
139
142
notify :
140
143
name : Notify
141
- runs-on : ubuntu-18 .04
144
+ runs-on : ubuntu-20 .04
142
145
needs : release-docker
143
146
if : always() && github.ref == 'refs/heads/master'
144
147
steps :
Original file line number Diff line number Diff line change 7
7
GO111MODULE=on go test ./...
8
8
9
9
binary :
10
- CGO_ENABLED=0 GO111MODULE=on GOOS=linux go build -trimpath -installsuffix cgo -o build/_output/bin/nginx-ingress-operator github.com/nginxinc/nginx-ingress-operator/cmd/manager
10
+ $(eval GOPATH=$(shell go env GOPATH) )
11
+ CGO_ENABLED=0 GO111MODULE=on GOFLAGS=" -gcflags=-trimpath=${GOPATH} -asmflags=-trimpath=${GOPATH} " GOOS=linux go build -trimpath -ldflags " -s -w" -o build/_output/bin/nginx-ingress-operator github.com/nginxinc/nginx-ingress-operator/cmd/manager
11
12
12
13
build : binary
13
14
docker build -f build/Dockerfile -t $(IMAGE ) :$(TAG ) .
You can’t perform that action at this time.
0 commit comments