Skip to content

Commit 251ca68

Browse files
Don't hardcode the go version to use for upgrade/downgrade tests. (#18920)
Signed-off-by: Arthur Schreiber <[email protected]>
1 parent 8ad84fb commit 251ca68

16 files changed

+286
-213
lines changed

.github/workflows/upgrade_downgrade_test_backups_e2e.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,14 @@ jobs:
6262
- 'bootstrap.sh'
6363
- '.github/workflows/upgrade_downgrade_test_backups_e2e.yml'
6464
65-
- name: Set up Go
65+
- name: Tune the OS
6666
if: steps.changes.outputs.end_to_end == 'true'
67-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
68-
with:
69-
go-version: 1.24.7
67+
uses: ./.github/actions/tune-os
7068

7169
- name: Set up python
7270
if: steps.changes.outputs.end_to_end == 'true'
7371
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
7472

75-
- name: Tune the OS
76-
if: steps.changes.outputs.end_to_end == 'true'
77-
uses: ./.github/actions/tune-os
78-
7973
- name: Setup MySQL
8074
if: steps.changes.outputs.end_to_end == 'true'
8175
uses: ./.github/actions/setup-mysql
@@ -93,11 +87,6 @@ jobs:
9387
9488
sudo service etcd stop
9589
96-
go mod download
97-
98-
# install JUnit report formatter
99-
go install github.com/vitessio/go-junit-report@HEAD
100-
10190
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
10291
sudo apt-get install -y gnupg2
10392
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
@@ -113,6 +102,13 @@ jobs:
113102
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
114103
persist-credentials: 'false'
115104

105+
- name: Set up Go
106+
if: steps.changes.outputs.end_to_end == 'true'
107+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
108+
with:
109+
go-version-file: go.mod
110+
cache: false
111+
116112
- name: Get dependencies for the last release
117113
if: steps.changes.outputs.end_to_end == 'true'
118114
run: |
@@ -135,6 +131,13 @@ jobs:
135131
with:
136132
persist-credentials: 'false'
137133

134+
- name: Set up Go
135+
if: steps.changes.outputs.end_to_end == 'true'
136+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
137+
with:
138+
go-version-file: go.mod
139+
cache: false
140+
138141
- name: Get dependencies for this commit
139142
if: steps.changes.outputs.end_to_end == 'true'
140143
run: |

.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,14 @@ jobs:
6464
- 'bootstrap.sh'
6565
- '.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml'
6666
67-
- name: Set up Go
67+
- name: Tune the OS
6868
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
69-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
70-
with:
71-
go-version-file: go.mod
69+
uses: ./.github/actions/tune-os
7270

7371
- name: Set up python
7472
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
7573
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
7674

77-
- name: Tune the OS
78-
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
79-
uses: ./.github/actions/tune-os
80-
8175
- name: Setup MySQL
8276
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
8377
uses: ./.github/actions/setup-mysql
@@ -95,11 +89,6 @@ jobs:
9589
9690
sudo service etcd stop
9791
98-
go mod download
99-
100-
# install JUnit report formatter
101-
go install github.com/vitessio/go-junit-report@HEAD
102-
10392
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
10493
sudo apt-get install -y gnupg2
10594
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
@@ -115,6 +104,13 @@ jobs:
115104
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
116105
persist-credentials: 'false'
117106

107+
- name: Set up Go
108+
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
109+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
110+
with:
111+
go-version-file: go.mod
112+
cache: false
113+
118114
- name: Get dependencies for the next release
119115
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
120116
run: |
@@ -137,6 +133,13 @@ jobs:
137133
with:
138134
persist-credentials: 'false'
139135

136+
- name: Set up Go
137+
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
138+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
139+
with:
140+
go-version-file: go.mod
141+
cache: false
142+
140143
- name: Get dependencies for this commit
141144
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
142145
run: |

.github/workflows/upgrade_downgrade_test_backups_manual.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
fetch-depth: 0
3838
persist-credentials: 'false'
3939

40-
- name: Set output with latest release branch
41-
id: output-previous-release-ref
42-
run: |
43-
previous_release_ref=$(./tools/get_previous_release.sh ${{github.base_ref}} ${{github.ref}})
44-
echo $previous_release_ref
45-
echo "previous_release_ref=${previous_release_ref}" >> $GITHUB_OUTPUT
46-
4740
- name: Check for changes in relevant files
4841
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
4942
id: changes
@@ -66,20 +59,23 @@ jobs:
6659
- '.github/workflows/upgrade_downgrade_test_backups_manual.yml'
6760
- 'examples/**'
6861
69-
- name: Set up Go
70-
if: steps.changes.outputs.end_to_end == 'true'
71-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
72-
with:
73-
go-version: 1.24.7
7462
75-
- name: Set up python
63+
- name: Set output with latest release branch
7664
if: steps.changes.outputs.end_to_end == 'true'
77-
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
65+
id: output-previous-release-ref
66+
run: |
67+
previous_release_ref=$(./tools/get_previous_release.sh ${{github.base_ref}} ${{github.ref}})
68+
echo $previous_release_ref
69+
echo "previous_release_ref=${previous_release_ref}" >> $GITHUB_OUTPUT
7870
7971
- name: Tune the OS
8072
if: steps.changes.outputs.end_to_end == 'true'
8173
uses: ./.github/actions/tune-os
8274

75+
- name: Set up python
76+
if: steps.changes.outputs.end_to_end == 'true'
77+
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
78+
8379
- name: Setup MySQL
8480
if: steps.changes.outputs.end_to_end == 'true'
8581
uses: ./.github/actions/setup-mysql
@@ -97,9 +93,6 @@ jobs:
9793
9894
sudo service etcd stop
9995
100-
# install JUnit report formatter
101-
go install github.com/vitessio/go-junit-report@HEAD
102-
10396
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
10497
sudo apt-get install -y gnupg2
10598
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
@@ -115,6 +108,13 @@ jobs:
115108
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
116109
persist-credentials: 'false'
117110

111+
- name: Set up Go
112+
if: steps.changes.outputs.end_to_end == 'true'
113+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
114+
with:
115+
go-version-file: go.mod
116+
cache: false
117+
118118
- name: Get dependencies for the last release
119119
if: steps.changes.outputs.end_to_end == 'true'
120120
run: |
@@ -137,6 +137,13 @@ jobs:
137137
with:
138138
persist-credentials: 'false'
139139

140+
- name: Set up Go
141+
if: steps.changes.outputs.end_to_end == 'true'
142+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
143+
with:
144+
go-version-file: go.mod
145+
cache: false
146+
140147
- name: Get dependencies for this commit
141148
if: steps.changes.outputs.end_to_end == 'true'
142149
run: |
@@ -278,7 +285,7 @@ jobs:
278285
echo "select count(sku) from corder;" | mysql 2>&1| grep 6
279286
280287
- name: Stop the Vitess cluster
281-
if: always() && steps.changes.outputs.end_to_end == 'true'
288+
if: steps.changes.outputs.end_to_end == 'true' && !cancelled()
282289
run: |
283290
source build.env ; cd examples/local
284291
./401_teardown.sh || true

.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
fetch-depth: 0
3838
persist-credentials: 'false'
3939

40-
- name: Set output with latest release branch
41-
id: output-next-release-ref
42-
run: |
43-
next_release_ref=$(./tools/get_next_release.sh ${{github.base_ref}} ${{github.ref}})
44-
echo $next_release_ref
45-
echo "next_release_ref=${next_release_ref}" >> $GITHUB_OUTPUT
46-
4740
- name: Check for changes in relevant files
4841
if: steps.output-next-release-ref.outputs.next_release_ref != ''
4942
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
@@ -67,20 +60,22 @@ jobs:
6760
- '.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml'
6861
- 'examples/**'
6962
70-
- name: Set up Go
63+
- name: Set output with latest release branch
64+
id: output-next-release-ref
65+
if: steps.changes.outputs.end_to_end == 'true'
66+
run: |
67+
next_release_ref=$(./tools/get_next_release.sh ${{github.base_ref}} ${{github.ref}})
68+
echo $next_release_ref
69+
echo "next_release_ref=${next_release_ref}" >> $GITHUB_OUTPUT
70+
71+
- name: Tune the OS
7172
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
72-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
73-
with:
74-
go-version-file: go.mod
73+
uses: ./.github/actions/tune-os
7574

7675
- name: Set up python
7776
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
7877
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
7978

80-
- name: Tune the OS
81-
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
82-
uses: ./.github/actions/tune-os
83-
8479
- name: Setup MySQL
8580
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
8681
uses: ./.github/actions/setup-mysql
@@ -98,9 +93,6 @@ jobs:
9893
9994
sudo service etcd stop
10095
101-
# install JUnit report formatter
102-
go install github.com/vitessio/go-junit-report@HEAD
103-
10496
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
10597
sudo apt-get install -y gnupg2
10698
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
@@ -116,6 +108,13 @@ jobs:
116108
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
117109
persist-credentials: 'false'
118110

111+
- name: Set up Go
112+
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
113+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
114+
with:
115+
go-version-file: go.mod
116+
cache: false
117+
119118
- name: Get dependencies for the next release
120119
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
121120
run: |
@@ -138,6 +137,13 @@ jobs:
138137
with:
139138
persist-credentials: 'false'
140139

140+
- name: Set up Go
141+
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
142+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
143+
with:
144+
go-version-file: go.mod
145+
cache: false
146+
141147
- name: Get dependencies for this commit
142148
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
143149
run: |
@@ -279,7 +285,7 @@ jobs:
279285
echo "select count(sku) from corder;" | mysql 2>&1| grep 6
280286
281287
- name: Stop the Vitess cluster
282-
if: always() && steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
288+
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true' && !cancelled()
283289
run: |
284290
source build.env ; cd examples/local
285291
./401_teardown.sh || true

.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,29 @@ jobs:
6060
- '.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml'
6161
6262
- name: Set output with latest release branch
63+
if: steps.changes.outputs.end_to_end == 'true'
6364
id: output-previous-release-ref
6465
run: |
6566
previous_release_ref=$(./tools/get_previous_release.sh ${{github.base_ref}} ${{github.ref}})
6667
echo $previous_release_ref
6768
echo "previous_release_ref=${previous_release_ref}" >> $GITHUB_OUTPUT
6869
6970
- name: Set output with next release branch
71+
if: steps.changes.outputs.end_to_end == 'true'
7072
id: output-next-release-ref
7173
run: |
7274
next_release_ref=$(./tools/get_next_release.sh ${{github.base_ref}} ${{github.ref}})
7375
echo $next_release_ref
7476
echo "next_release_ref=${next_release_ref}" >> $GITHUB_OUTPUT
7577
76-
- name: Set up Go
78+
- name: Tune the OS
7779
if: steps.changes.outputs.end_to_end == 'true'
78-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
79-
with:
80-
go-version: 1.24.7
80+
uses: ./.github/actions/tune-os
8181

8282
- name: Set up python
8383
if: steps.changes.outputs.end_to_end == 'true'
8484
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
8585

86-
- name: Tune the OS
87-
if: steps.changes.outputs.end_to_end == 'true'
88-
uses: ./.github/actions/tune-os
89-
9086
- name: Setup MySQL
9187
if: steps.changes.outputs.end_to_end == 'true'
9288
uses: ./.github/actions/setup-mysql
@@ -104,9 +100,6 @@ jobs:
104100
105101
sudo service etcd stop
106102
107-
# install JUnit report formatter
108-
go install github.com/vitessio/go-junit-report@HEAD
109-
110103
# Checkout to the last release of Vitess
111104
- name: Check out last version's code (${{ steps.output-previous-release-ref.outputs.previous_release_ref }})
112105
if: steps.changes.outputs.end_to_end == 'true'
@@ -115,6 +108,13 @@ jobs:
115108
ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
116109
persist-credentials: 'false'
117110

111+
- name: Set up Go
112+
if: steps.changes.outputs.end_to_end == 'true'
113+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
114+
with:
115+
go-version-file: go.mod
116+
cache: false
117+
118118
- name: Get dependencies for the last release
119119
if: steps.changes.outputs.end_to_end == 'true'
120120
run: |
@@ -139,6 +139,13 @@ jobs:
139139
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
140140
persist-credentials: 'false'
141141

142+
- name: Set up Go
143+
if: steps.changes.outputs.end_to_end == 'true'
144+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
145+
with:
146+
go-version-file: go.mod
147+
cache: false
148+
142149
- name: Get dependencies for the next release
143150
if: steps.changes.outputs.end_to_end == 'true'
144151
run: |
@@ -162,6 +169,13 @@ jobs:
162169
with:
163170
persist-credentials: 'false'
164171

172+
- name: Set up Go
173+
if: steps.changes.outputs.end_to_end == 'true'
174+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
175+
with:
176+
go-version-file: go.mod
177+
cache: false
178+
165179
- name: Get dependencies for this commit
166180
if: steps.changes.outputs.end_to_end == 'true'
167181
run: |

0 commit comments

Comments
 (0)