This repository was archived by the owner on May 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 2525
2626env :
2727 DOCKER_BUILDKIT : 1
28- GOLANG_VERSION : 1.16
2928
3029jobs :
3130
3231 binary :
3332 name : Build Binary
34- runs-on : ubuntu-18 .04
33+ runs-on : ubuntu-20 .04
3534 steps :
3635 - name : Checkout Repository
3736 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 }}
3843 - name : Build Binary
3944 run : make binary
40- env :
41- GOFLAGS : ' -gcflags=-trimpath=${{ github.workspace }} -asmflags=-trimpath=${{ github.workspace }}'
4245 - name : Cache Artifacts
4346 uses : actions/cache@v2.1.4
4447 with :
@@ -47,20 +50,20 @@ jobs:
4750
4851 unit-tests :
4952 name : Unit Tests
50- runs-on : ubuntu-18 .04
53+ runs-on : ubuntu-20 .04
5154 steps :
5255 - name : Checkout Repository
5356 uses : actions/checkout@v2
5457 - name : Setup Golang Environment
5558 uses : actions/setup-go@v2
5659 with :
57- go-version : ' ${{ env.GOLANG_VERSION }}'
60+ go-version : ${{ env.GO_VERSION }}
5861 - name : Run Tests
5962 run : make test
6063
6164 build :
6265 name : Build Image
63- runs-on : ubuntu-18 .04
66+ runs-on : ubuntu-20 .04
6467 needs : [binary, unit-tests]
6568 steps :
6669 - name : Checkout Repository
9396
9497 release-docker :
9598 name : Release Image
96- runs-on : ubuntu-18 .04
99+ runs-on : ubuntu-20 .04
97100 needs : [build, unit-tests]
98101 if :
99102 github.repository == 'nginxinc/nginx-ingress-operator' &&
@@ -138,7 +141,7 @@ jobs:
138141
139142 notify :
140143 name : Notify
141- runs-on : ubuntu-18 .04
144+ runs-on : ubuntu-20 .04
142145 needs : release-docker
143146 if : always() && github.ref == 'refs/heads/master'
144147 steps :
Original file line number Diff line number Diff line change 77 GO111MODULE=on go test ./...
88
99binary :
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
1112
1213build : binary
1314 docker build -f build/Dockerfile -t $(IMAGE ) :$(TAG ) .
You can’t perform that action at this time.
0 commit comments