1
- name : Continuous Integration
1
+ name : CI
2
2
3
3
on :
4
4
push :
23
23
env :
24
24
DOCKER_PLATFORMS : " linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x,linux/mips64le,linux/386"
25
25
26
-
27
26
jobs :
28
27
29
28
unit-tests :
@@ -32,12 +31,11 @@ jobs:
32
31
steps :
33
32
- name : Checkout Repository
34
33
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
37
34
- name : Setup Golang Environment
38
35
uses : actions/setup-go@v3
39
36
with :
40
- go-version : ${{ env.GO_VERSION }}
37
+ go-version-file : go.mod
38
+ cache : true
41
39
- name : Run Tests
42
40
run : make test
43
41
@@ -50,12 +48,15 @@ jobs:
50
48
uses : actions/checkout@v3
51
49
with :
52
50
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
55
51
- name : Setup Golang Environment
56
52
uses : actions/setup-go@v3
57
53
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)"
59
60
- name : Setup QEMU
60
61
uses : docker/setup-qemu-action@v2
61
62
with :
@@ -123,7 +124,7 @@ jobs:
123
124
args : ${{ !startsWith(github.ref, 'refs/tags/') && 'build --snapshot' || 'release' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --rm-dist
124
125
env :
125
126
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126
- GOPATH : ${{ env.GOPATH }}
127
+ GOPATH : ${{ steps.go.outputs.go_path }}
127
128
HOMEBREW_TAP_GITHUB_TOKEN : ${{ secrets.NGINX_PAT }}
128
129
- name : Push to Dockerhub
129
130
uses : docker/build-push-action@v3
@@ -138,5 +139,3 @@ jobs:
138
139
push : ${{ github.event_name != 'pull_request' }}
139
140
cache-from : type=gha
140
141
cache-to : type=gha,mode=max
141
- build-args : |
142
- VERSION=${{ steps.meta.outputs.version }}
0 commit comments