-
Notifications
You must be signed in to change notification settings - Fork 6
250 lines (233 loc) · 7.57 KB
/
integration.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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: integration
on:
push:
branches: [ main ]
workflow_dispatch:
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
install_go_tip:
name: install tip
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- windows-2022
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/[email protected]
- id: setup_go
name: install tip
uses: ./
with:
go-version: tip
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"devel"* ]]
install_go:
name: install go
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2022
- macos-11
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/[email protected]
- id: setup_go_1_15_5
name: install 1.15.5
uses: ./
with:
go-version: '1.15.5'
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_15_5.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.15.5"* ]]
[[ '${{steps.setup_go_1_15_5.outputs.GOROOT}}' == *"1.15.5"* ]]
[[ '${{steps.setup_go_1_15_5.outputs.GOTOOLDIR}}' == *"1.15.5"* ]]
- id: setup_go_1_16rc1
name: install 1.16rc1
uses: ./
with:
go-version: '1.16rc1'
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_16rc1.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.16rc1"* ]]
[[ '${{steps.setup_go_1_16rc1.outputs.GOROOT}}' == *"16rc1"* ]]
[[ '${{steps.setup_go_1_16rc1.outputs.GOTOOLDIR}}' == *"16rc1"* ]]
- id: setup_go_all
name: install '*'
uses: ./
with:
go-version: '*'
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_all.outputs ) }}' | jq .
go version
- id: setup_go_1_15_5_again
name: install 1.15.5 again
uses: ./
with:
go-version: '1.15.x <1.15.6'
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_15_5_again.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.15.5"* ]]
[[ '${{steps.setup_go_1_15_5_again.outputs.GOROOT}}' == *"1.15.5"* ]]
[[ '${{steps.setup_go_1_15_5_again.outputs.GOTOOLDIR}}' == *"1.15.5"* ]]
- id: setup_go_1_13_x
name: install 1.13.x
uses: ./
with:
go-version: '1.13.x'
ignore-local: true
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_13_x.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.13"* ]]
[[ '${{steps.setup_go_1_13_x.outputs.GOROOT}}' == *"1.13"* ]]
[[ '${{steps.setup_go_1_13_x.outputs.GOTOOLDIR}}' == *"1.13"* ]]
- id: setup_go_1_21
name: install 1.21
uses: ./
with:
go-version: '1.21'
ignore-local: true
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_21.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.21.0"* ]]
[[ '${{steps.setup_go_1_21.outputs.GOROOT}}' == *"1.21.0"* ]]
[[ '${{steps.setup_go_1_21.outputs.GOTOOLDIR}}' == *"1.21.0"* ]]
- id: setup_go_1_21_0
name: install 1.21.0
uses: ./
with:
go-version: '1.21.0'
ignore-local: true
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_21.outputs ) }}' | jq .
go version
set -ex
[[ "$(go version)" == *"1.21.0"* ]]
[[ '${{steps.setup_go_1_21.outputs.GOROOT}}' == *"1.21.0"* ]]
[[ '${{steps.setup_go_1_21.outputs.GOTOOLDIR}}' == *"1.21.0"* ]]
- name: create_go_mod 1.15
run: |
mkdir -p tmp/go_mod_1_15
cat >> tmp/go_mod_1_15/go.mod << EOF
module example.com/some-module
go 1.15
require (
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691
golang.org/x/sync v0.3.0
)
- id: setup_go_1_15_from_go_mod
name: install 1.15 from go.mod
uses: ./
with:
go-version-file: 'tmp/go_mod_1_15/go.mod'
ignore-local: true
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_15_from_go_mod.outputs ) }}' | jq .
go version
set -ex
requested_min_version='1.15'
installed_version="$(go version | cut -d " " -f 3 | tr -d "go")"
lowest_version="$(echo -e "$requested_min_version\n$installed_version" | sort -rV | tail -1)"
[[ "$lowest_version" == "$requested_min_version" ]]
[[ '${{steps.setup_go_1_15_from_go_mod.outputs.GOROOT}}' == *"$installed_version"* ]]
[[ '${{steps.setup_go_1_15_from_go_mod.outputs.GOTOOLDIR}}' == *"$installed_version"* ]]
- name: create_go_mod 1.21rc1
run: |
mkdir -p tmp/go_mod_1_21rc1
cat >> tmp/go_mod_1_21rc1/go.mod << EOF
module example.com/some-module
go 1.21rc1
require (
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691
golang.org/x/sync v0.3.0
)
- id: setup_go_1_21rc1_from_go_mod
name: install 1.21rc1 from go.mod
uses: ./
with:
go-version-file: 'tmp/go_mod_1_21rc1/go.mod'
ignore-local: true
- name: outputs
run: |
echo '*********** env ************'
env
echo '*********** go env ***********'
go env
echo '${{ toJson( steps.setup_go_1_21rc1_from_go_mod.outputs ) }}' | jq .
go version
set -ex
requested_min_version='1.21rc1'
installed_version="$(go version | cut -d " " -f 3 | tr -d "go")"
lowest_version="$(echo -e "$requested_min_version\n$installed_version" | sort -rV | tail -1)"
[[ "$lowest_version" == "$requested_min_version" ]]
[[ '${{steps.setup_go_1_21rc1_from_go_mod.outputs.GOROOT}}' == *"$installed_version"* ]]
[[ '${{steps.setup_go_1_21rc1_from_go_mod.outputs.GOTOOLDIR}}' == *"$installed_version"* ]]