-
Notifications
You must be signed in to change notification settings - Fork 80
228 lines (221 loc) · 7.06 KB
/
autotest.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Test
on:
push:
branches-ignore:
- '*-prebuilt'
- 'release/**'
tags:
- 'v**'
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
acceptance-test:
name: Acceptance Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64, arm]
exclude:
- goarch: arm64
goos: windows
- goarch: amd64
goos: linux
- goarch: amd64
goos: windows
- goarch: arm
goos: darwin
- goarch: arm
goos: windows
include:
- goos: linux
goarch: amd64
goamd64: v1
- goos: linux
goarch: amd64
goamd64: v3
- goos: windows
goarch: amd64
goamd64: v1
- goos: windows
goarch: amd64
goamd64: v3
- goos: darwin
goarch: amd64
- goos: linux
goarch: arm
goarm: "7"
steps:
# - name: Wait release docker build for release branches
# if: contains(github.ref, 'release')
# uses: jakejarvis/wait-action@master
# with:
# time: '300s'
- name: Checkout
uses: actions/checkout@v4
- name: Set BUILD_TIME env
run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV}
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goamd64: ${{ matrix.goamd64 }}
goarm: ${{ matrix.goarm }}
goversion: https://go.dev/dl/go1.19.7.linux-amd64.tar.gz
project_path: ./test/
binary_name: testmain
pre_command: go mod init localtest
executable_compression: upx -v
build_flags: -v
ldflags: -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
md5sum: false
sha256sum: true
overwrite: true
release_tag: v0.1-test-assets
asset_name: testmain-acceptance-${{ matrix.goos }}-${{ matrix.goarch }}
retry: 5
post_command: echo "RELEASE_ASSET_FILE=$RELEASE_ASSET_FILE"
setup-go-test:
name: Set up Go Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64]
# "" means default
goversion: ["", "1.21", "1.21.1", "https://go.dev/dl/go1.21.6.linux-amd64.tar.gz"]
steps:
# - name: Wait release docker build for release branches
# if: contains(github.ref, 'release')
# uses: jakejarvis/wait-action@master
# with:
# time: '300s'
- name: Checkout
uses: actions/checkout@v4
- name: Set GO_VERSION_TAG env
run: echo GO_VERSION_TAG=$(basename ${{ matrix.goversion }}) >> ${GITHUB_ENV}
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: ${{ matrix.goversion }}
project_path: ./test/
binary_name: testmain
pre_command: go mod init localtest
build_flags: -v
ldflags: -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
md5sum: false
overwrite: true
release_tag: v0.1-test-assets
asset_name: testmain-set-up-go-${{ env.GO_VERSION_TAG }}-${{ matrix.goos }}-${{ matrix.goarch }}
setup-go-with-gomod-test:
name: Set up Go with go.mod Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64]
goversion: ["go.mod", "./go.mod", ""]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set GO_VERSION_TAG env
run: echo GO_VERSION_TAG=$(basename ${{ matrix.goversion }}) >> ${GITHUB_ENV}
- name: Generate go.mod
run: go mod init localtest
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: ${{ matrix.goversion }}
project_path: ./test/
binary_name: testmain
build_flags: -v
ldflags: -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
md5sum: false
overwrite: true
release_tag: v0.1-test-assets
asset_name: testmain-set-up-go-${{ env.GO_VERSION_TAG }}-${{ matrix.goos }}-${{ matrix.goarch }}
build-via-makefile-test:
name: Makefile Build Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: https://go.dev/dl/go1.16.6.linux-amd64.tar.gz
project_path: ./test/
binary_name: testmain
pre_command: go mod init localtest
build_command: make app
md5sum: false
sha256sum: false
overwrite: true
release_tag: v0.1-test-assets
asset_name: testmain-via-makefile-${{ matrix.goos }}-${{ matrix.goarch }}
compress-assets-test:
name: Compress assets off Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
compress_assets: ['auto', 'true', 'zip', 'off', 'false']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: ./test/
binary_name: testmain
pre_command: go mod init localtest
build_flags: -v
overwrite: true
release_tag: v0.1-test-assets
compress_assets: ${{ matrix.compress_assets }}
multi-binaries-test:
name: Multi Binaries Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
project_path: [./test/multi-binaries/..., './test/multi-binaries/cmd1 ./test/multi-binaries/cmd2']
steps:
- name: Set BUILD_TIME env
run: echo BUILD_TIME=$(date -u +%Y%m%dT%H%M%S) >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v4
- name: Run go-release-action on test code
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: ${{ matrix.project_path }}
pre_command: go mod init localtest
extra_files: LICENSE README.md
build_flags: -v -tags v0.1-test-assets-${{ env.BUILD_TIME }}
overwrite: true
release_tag: v0.1-test-assets
multi_binaries: true