1- name : Continuous Integration
1+ name : CI
22
33on :
44 push :
2323env :
2424 DOCKER_PLATFORMS : " linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x,linux/mips64le,linux/386"
2525
26-
2726jobs :
2827
2928 unit-tests :
@@ -32,12 +31,11 @@ jobs:
3231 steps :
3332 - name : Checkout Repository
3433 uses : actions/checkout@v3
35- - name : Determine Go version from go.mod
36- run : echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
3734 - name : Setup Golang Environment
3835 uses : actions/setup-go@v3
3936 with :
40- go-version : ${{ env.GO_VERSION }}
37+ go-version-file : go.mod
38+ cache : true
4139 - name : Run Tests
4240 run : make test
4341
@@ -50,12 +48,15 @@ jobs:
5048 uses : actions/checkout@v3
5149 with :
5250 fetch-depth : 0
53- - name : Determine Go version from go.mod
54- run : echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
5551 - name : Setup Golang Environment
5652 uses : actions/setup-go@v3
5753 with :
58- go-version : ${{ env.GO_VERSION }}
54+ go-version-file : go.mod
55+ cache : true
56+ - name : Determine GOPATH
57+ id : go
58+ run : |
59+ echo "::set-output name=go_path::$(go env GOPATH)"
5960 - name : Setup QEMU
6061 uses : docker/setup-qemu-action@v2
6162 with :
@@ -123,7 +124,7 @@ jobs:
123124 args : ${{ !startsWith(github.ref, 'refs/tags/') && 'build --snapshot' || 'release' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --rm-dist
124125 env :
125126 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126- GOPATH : ${{ env.GOPATH }}
127+ GOPATH : ${{ steps.go.outputs.go_path }}
127128 HOMEBREW_TAP_GITHUB_TOKEN : ${{ secrets.NGINX_PAT }}
128129 - name : Push to Dockerhub
129130 uses : docker/build-push-action@v3
@@ -138,5 +139,3 @@ jobs:
138139 push : ${{ github.event_name != 'pull_request' }}
139140 cache-from : type=gha
140141 cache-to : type=gha,mode=max
141- build-args : |
142- VERSION=${{ steps.meta.outputs.version }}
0 commit comments