@@ -60,64 +60,78 @@ jobs:
6060
6161 strategy :
6262 matrix :
63- scylla-version : [ENTERPRISE-RELEASE, ENTERPRISE -PRIOR-RELEASE ]
63+ scylla-version : [LATEST, PRIOR, LTS-LATEST, LTS -PRIOR]
6464 fail-fast : false
6565
6666 steps :
6767 - name : Checkout
6868 uses : actions/checkout@v4
6969
70- - name : Setup Python 3
71- uses : actions/setup-python@v5
72- with :
73- python-version : " 3.11"
74-
7570 - name : Update apt cache
7671 run : sudo apt-get update -y
7772
7873 - name : Install CCM
74+ run : make install-ccm-if-missing
75+
76+ - name : Select scylla filter
77+ id : scylla-filter
7978 run : |
80- make install-ccm-if-missing
79+ # Select the latest stable patch on each release line and drop
80+ # prerelease tags before taking the requested position.
81+ case "${{ matrix.scylla-version }}" in
82+ LATEST)
83+ printf 'value=%s\n' '^[0-9]{4}$.^[2-9][0-9]*$.LAST and *.*.^[0-9]+$ and LAST' >> "$GITHUB_OUTPUT"
84+ ;;
85+ PRIOR)
86+ printf 'value=%s\n' '^[0-9]{4}$.^[2-9][0-9]*$.LAST and *.*.^[0-9]+$ and LAST-1' >> "$GITHUB_OUTPUT"
87+ ;;
88+ LTS-LATEST)
89+ printf 'value=%s\n' '^[0-9]{4}$.1.LAST and *.*.^[0-9]+$ and LAST' >> "$GITHUB_OUTPUT"
90+ ;;
91+ LTS-PRIOR)
92+ printf 'value=%s\n' '^[0-9]{4}$.1.LAST and *.*.^[0-9]+$ and LAST-1' >> "$GITHUB_OUTPUT"
93+ ;;
94+ *)
95+ echo "Unknown scylla version name ${{ matrix.scylla-version }}"
96+ exit 1
97+ ;;
98+ esac
8199
82100 - name : Get scylla version
83101 id : scylla-version
102+ uses : scylladb-actions/get-version@v0.4.5
103+ with :
104+ source : dockerhub-imagetag
105+ repo : scylladb/scylla
106+ filters : ${{ steps.scylla-filter.outputs.value }}
107+
108+ - name : Resolve scylla version
109+ id : scylla-version-value
84110 run : |
85- if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
86- echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
87- elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then
88- echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
89- elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then
90- echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT
91- elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
92- echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
93- elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then
94- echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
95- elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then
96- echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT
97- elif echo "${{ matrix.scylla-version }}" | grep -P '^[0-9\.]+'; then # If you want to run specific version do just that
98- echo "value=${{ matrix.scylla-version }}" | tee -a $GITHUB_OUTPUT
99- else
100- echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
111+ value='${{ fromJson(steps.scylla-version.outputs.versions)[0] }}'
112+ if [ -z "$value" ]; then
113+ echo "No Scylla version resolved for ${{ matrix.scylla-version }}" >&2
101114 exit 1
102115 fi
116+ echo "value=$value" | tee -a "$GITHUB_OUTPUT"
103117
104118 - name : Pull CCM image from the cache
105119 uses : actions/cache/restore@v4
106120 id : pull-image
107121 with :
108122 path : ~/.ccm/scylla-repository
109- key : image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
123+ key : image-scylla-${{ runner.os }}-${{ steps.scylla-version-value .outputs.value }}
110124
111- - name : Download Scylla (${{ steps.scylla-version.outputs.value }}) image
125+ - name : Download Scylla (${{ steps.scylla-version-value .outputs.value }}) image
112126 if : steps.pull-image.outputs.cache-hit != 'true'
113- run : SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make download-ccm-scylla-image
127+ run : SCYLLA_VERSION="release:${{ steps.scylla-version-value .outputs.value }}" make download-ccm-scylla-image
114128
115129 - name : Save CCM image cache
116130 uses : actions/cache/save@v4
117131 if : steps.pull-image.outputs.cache-hit != 'true'
118132 with :
119133 path : ~/.ccm/scylla-repository
120- key : image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
134+ key : image-scylla-${{ runner.os }}-${{ steps.scylla-version-value .outputs.value }}
121135
122136 - name : Pull integration test binary
123137 uses : actions/cache/restore@v4
@@ -134,9 +148,9 @@ jobs:
134148 - name : Prepare environment
135149 run : make update-rust-tooling prepare-integration-test
136150
137- - name : Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }}
151+ - name : Run integration tests on Scylla ${{ steps.scylla-version-value .outputs.value }}
138152 id : run-integration-tests
139- run : SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make run-test-integration-scylla
153+ run : SCYLLA_VERSION="release:${{ steps.scylla-version-value .outputs.value }}" make run-test-integration-scylla
140154
141155 - name : Upload test logs
142156 uses : actions/upload-artifact@v4
@@ -158,7 +172,7 @@ jobs:
158172
159173 strategy :
160174 matrix :
161- cassandra-version : [RELEASE-3.X ]
175+ cassandra-version : [3-LATEST ]
162176 java-version : [8]
163177 fail-fast : false
164178
@@ -172,11 +186,6 @@ jobs:
172186 java-version : ${{ matrix.java-version }}
173187 distribution : " adopt"
174188
175- - name : Setup Python 3
176- uses : actions/setup-python@v5
177- with :
178- python-version : " 3.11"
179-
180189 - name : Update apt cache
181190 run : sudo apt-get update -y
182191
@@ -185,32 +194,38 @@ jobs:
185194
186195 - name : Get cassandra version
187196 id : cassandra-version
197+ uses : scylladb-actions/get-version@v0.4.5
198+ with :
199+ source : github-tag
200+ repo : apache/cassandra
201+ prefix : cassandra-
202+ out-no-prefix : true
203+ github-token : ${{ secrets.GITHUB_TOKEN }}
204+ filters : ' ^[0-9]+$.^[0-9]+$.^[0-9]+$ and 3.LAST.LAST'
205+
206+ - name : Resolve cassandra version
207+ id : cassandra-version-value
188208 run : |
189- if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
190- echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
191- elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
192- echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
193- else
194- echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
195- fi
209+ value=${{ fromJson(steps.cassandra-version.outputs.versions)[0] }}
210+ echo "value=${value#cassandra-}" | tee -a "$GITHUB_OUTPUT"
196211
197212 - name : Pull CCM image from the cache
198213 uses : actions/cache/restore@v4
199214 id : pull-image
200215 with :
201216 path : ~/.ccm/repository
202- key : image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
217+ key : image-cassandra-${{ runner.os }}-${{ steps.cassandra-version-value .outputs.value }}
203218
204- - name : Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
219+ - name : Download Cassandra (${{ steps.cassandra-version-value .outputs.value }}) image
205220 if : steps.pull-image.outputs.cache-hit != 'true'
206- run : CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make download-ccm-cassandra-image
221+ run : CASSANDRA_VERSION="${{ steps.cassandra-version-value .outputs.value }}" make download-ccm-cassandra-image
207222
208223 - name : Save CCM image cache
209224 uses : actions/cache/save@v4
210225 if : steps.pull-image.outputs.cache-hit != 'true'
211226 with :
212227 path : ~/.ccm/repository
213- key : image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
228+ key : image-cassandra-${{ runner.os }}-${{ steps.cassandra-version-value .outputs.value }}
214229
215230 - name : Pull integration test binary
216231 uses : actions/cache/restore@v4
@@ -227,9 +242,9 @@ jobs:
227242 - name : Prepare environment
228243 run : make update-rust-tooling prepare-integration-test
229244
230- - name : Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }}
245+ - name : Run integration tests on Cassandra ${{ steps.cassandra-version-value .outputs.value }}
231246 id : run-integration-tests
232- run : CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make run-test-integration-cassandra
247+ run : CASSANDRA_VERSION="${{ steps.cassandra-version-value .outputs.value }}" make run-test-integration-cassandra
233248
234249 - name : Upload test logs
235250 uses : actions/upload-artifact@v4
0 commit comments