Skip to content

Commit 5833be1

Browse files
committed
cicd: move all cicd code into a Makefile
Move all CICD code into a Makefile. Update all workflows to use Makefile.
1 parent 18752f6 commit 5833be1

File tree

5 files changed

+311
-77
lines changed

5 files changed

+311
-77
lines changed

.github/workflows/re-release.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
version_tag:
77
type: string
8-
description: ''
8+
description: 'version or tag to release it again'
99
required: true
1010

1111
jobs:
@@ -16,9 +16,6 @@ jobs:
1616
permissions:
1717
contents: write
1818

19-
env:
20-
MVNCMD: mvn -B -X -ntp
21-
2219
steps:
2320
- name: Checkout Repository
2421
uses: actions/checkout@v5
@@ -44,20 +41,14 @@ jobs:
4441
git config user.name "ScyllaDB Promoter"
4542
git config user.email "[email protected]"
4643
47-
- name: Clean project
48-
run: $MVNCMD clean
49-
50-
- name: Clean release
51-
run: $MVNCMD release:clean
52-
5344
- name: Prepare release
5445
env:
5546
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
56-
run: $MVNCMD release:prepare -DskipTests -Darguments="-DskipTests" -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
47+
run: make release-prepare
5748

5849
- name: Perform release
5950
env:
6051
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
6152
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
6253
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
63-
run: $MVNCMD release:perform -DscmSkip=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
54+
run: make release

.github/workflows/release.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
dryrun:
77
type: boolean
8-
description: 'dryrun: run without pushing SCM changes to upstream'
8+
description: 'dryrun: run without publishing the package'
99
default: true
1010

1111
jobs:
@@ -47,18 +47,26 @@ jobs:
4747
- name: Prepare release
4848
env:
4949
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
50-
run: $MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
50+
run: make release-prepare
5151

5252
- name: Perform release
5353
env:
5454
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5555
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5656
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
57-
if: ${{ github.event.inputs.dryrun == 'false' }}
58-
run: $MVNCMD release:perform -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
57+
if: ${{ github.event.inputs.dryrun == false }}
58+
run: make release
59+
60+
- name: Perform dry-run release
61+
env:
62+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
63+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
64+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
65+
if: ${{ github.event.inputs.dryrun == true }}
66+
run: make release-dry-run
5967

6068
- name: Push changes to SCM
61-
if: ${{ github.event.inputs.dryrun == 'false' }}
69+
if: ${{ github.event.inputs.dryrun == false }}
6270
run: |
6371
git status && git log -3
6472
git push origin --follow-tags -v

.github/workflows/[email protected]

Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,12 @@ jobs:
6161
path: ~/.m2/repository
6262
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ steps.get-pom-hash.outputs.value }}
6363

64-
- name: Install guava-shaded
65-
run: mvn install -pl guava-shaded
66-
6764
- name: Compile source and tests
68-
run: mvn -B compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
65+
run: make compile-all
6966

7067
- name: Download test dependencies
7168
if: steps.java-cache.outputs.cache-hit != 'true'
72-
run: mvn -B test -Dtest=TestThatDoesNotExists -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true || true
73-
74-
- name: Download verify dependencies
75-
if: steps.java-cache.outputs.cache-hit != 'true'
76-
run: mvn -B verify -DskipTests || true
69+
run: make download-all-dependencies
7770

7871
- name: Save maven repository cache
7972
uses: actions/cache/save@v4
@@ -109,8 +102,7 @@ jobs:
109102
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
110103

111104
- name: Full verify
112-
run: mvn -B verify -DskipTests
113-
105+
run: make check
114106

115107
unit-tests:
116108
name: Unit tests
@@ -138,11 +130,8 @@ jobs:
138130
path: ~/.m2/repository
139131
key: ${{ runner.os }}-${{ matrix.java-version }}-maven-${{ hashFiles('**/pom.xml') }}
140132

141-
- name: Install guava-shaded
142-
run: mvn install -pl guava-shaded
143-
144133
- name: Run unit tests
145-
run: mvn -B test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
134+
run: make test-unit
146135

147136
- name: Copy test results
148137
if: always()
@@ -192,7 +181,7 @@ jobs:
192181

193182
strategy:
194183
matrix:
195-
cassandra-version: [RELEASE-3.X, RELEASE-4.X]
184+
cassandra-version: [3-LATEST, 4-LATEST]
196185
java-version: [8]
197186
fail-fast: false
198187

@@ -218,19 +207,13 @@ jobs:
218207
python-version: '3.13'
219208

220209
- name: Setup environment
221-
run: |
222-
pip3 install https://github.com/scylladb/scylla-ccm/archive/master.zip
210+
run: make install-cassandra-ccm
223211

224212
- name: Get cassandra version
225213
id: cassandra-version
226-
run: |
227-
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
228-
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
229-
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
230-
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
231-
else
232-
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
233-
fi
214+
env:
215+
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
216+
run: make resolve-cassandra-version
234217

235218
- name: Pull CCM image from the cache
236219
uses: actions/cache/restore@v4
@@ -241,11 +224,9 @@ jobs:
241224

242225
- name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
243226
if: steps.ccm-cache.outputs.cache-hit != 'true'
244-
run: |
245-
rm -rf /tmp/download.ccm || true
246-
mkdir /tmp/download.ccm || true
247-
ccm create ccm_1 -i 127.0.1. -n 3:0 -v "${{ steps.cassandra-version.outputs.value }}" --config-dir=/tmp/download.ccm
248-
rm -rf /tmp/download.ccm
227+
env:
228+
CASSANDRA_VERSION_RESOLVED: ${{ steps.cassandra-version.outputs.value }}
229+
run: make download-cassandra
249230

250231
- name: Save CCM image into the cache
251232
if: steps.ccm-cache.outputs.cache-hit != 'true'
@@ -256,7 +237,9 @@ jobs:
256237

257238
- name: Run integration tests on Cassandra (${{ steps.cassandra-version.outputs.value }})
258239
id: run-integration-tests
259-
run: mvn -B -e verify -Dccm.version=${{ steps.cassandra-version.outputs.value }} -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
240+
env:
241+
CASSANDRA_VERSION_RESOLVED: ${{ steps.cassandra-version.outputs.value }}
242+
run: make test-integration-cassandra
260243

261244
- name: Copy test results
262245
if: steps.run-integration-tests.outcome == 'failure'
@@ -299,7 +282,7 @@ jobs:
299282

300283
strategy:
301284
matrix:
302-
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE]
285+
scylla-version: [LTS-LATEST, LTS-PRIOR, LATEST]
303286
java-version: [8]
304287
fail-fast: false
305288

@@ -324,30 +307,12 @@ jobs:
324307
with:
325308
python-version: '3.13'
326309

327-
- name: Setup environment
328-
run: |
329-
pip3 install https://github.com/scylladb/scylla-ccm/archive/master.zip
330-
sudo sh -c "echo 2097152 > /proc/sys/fs/aio-max-nr"
310+
- name: Install CCM
311+
run: make install-scylla-ccm
331312

332313
- name: Get scylla version
333314
id: scylla-version
334-
run: |
335-
if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
336-
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
337-
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then
338-
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2 | tr -d '\"')" >> $GITHUB_OUTPUT
339-
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then
340-
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc | tr -d '\"')" >> $GITHUB_OUTPUT
341-
elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
342-
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1 | tr -d '\"')" >> $GITHUB_OUTPUT
343-
elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then
344-
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2 | tr -d '\"')" >> $GITHUB_OUTPUT
345-
elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then
346-
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc | tr -d '\"')" >> $GITHUB_OUTPUT
347-
else
348-
echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
349-
exit 1
350-
fi
315+
run: make resolve-scylla-version
351316

352317
- name: Pull CCM image from the cache
353318
uses: actions/cache/restore@v4
@@ -358,11 +323,9 @@ jobs:
358323

359324
- name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image
360325
if: steps.ccm-cache.outputs.cache-hit != 'true'
361-
run: |
362-
rm -rf /tmp/download.ccm || true
363-
mkdir /tmp/download.ccm || true
364-
ccm create ccm_1 -i 127.0.1. -n 3:0 -v "release:${{ steps.scylla-version.outputs.value }}" --scylla --config-dir=/tmp/download.ccm
365-
rm -rf /tmp/download.ccm
326+
env:
327+
SCYLLA_VERSION_RESOLVED: ${{ steps.scylla-version.outputs.value }}
328+
run: make download-scylla
366329

367330
- name: Save CCM image into the cache
368331
uses: actions/cache/save@v4
@@ -373,7 +336,9 @@ jobs:
373336

374337
- name: Run integration tests on Scylla (${{ steps.scylla-version.outputs.value }})
375338
id: run-integration-tests
376-
run: mvn -B verify -Dccm.version=${{ steps.scylla-version.outputs.value }} -Dccm.distribution=scylla -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
339+
env:
340+
SCYLLA_VERSION_RESOLVED: ${{ steps.scylla-version.outputs.value }}
341+
run: make test-integration-scylla
377342

378343
- name: Copy test results
379344
if: steps.run-integration-tests.outcome == 'failure'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ docs/_build
1010
docs/_source
1111
html
1212
latex
13+
bin/
1314

1415
.java-version
1516
.flattened-pom.xml

0 commit comments

Comments
 (0)