Skip to content

Commit b60f6ad

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 5437f0d commit b60f6ad

File tree

5 files changed

+296
-73
lines changed

5 files changed

+296
-73
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: 12 additions & 4 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,15 +47,23 @@ 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
6169
if: ${{ github.event.inputs.dryrun == 'false' }}

.github/workflows/[email protected]

Lines changed: 23 additions & 57 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

@@ -223,14 +212,9 @@ jobs:
223212
224213
- name: Get cassandra version
225214
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
215+
env:
216+
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
217+
run: make resolve-cassandra-version
234218

235219
- name: Pull CCM image from the cache
236220
uses: actions/cache/restore@v4
@@ -241,11 +225,9 @@ jobs:
241225

242226
- name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
243227
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
228+
env:
229+
CASSANDRA_VERSION_RESOLVED: ${{ steps.cassandra-version.outputs.value }}
230+
run: make download-cassandra
249231

250232
- name: Save CCM image into the cache
251233
if: steps.ccm-cache.outputs.cache-hit != 'true'
@@ -256,7 +238,9 @@ jobs:
256238

257239
- name: Run integration tests on Cassandra (${{ steps.cassandra-version.outputs.value }})
258240
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
241+
env:
242+
CASSANDRA_VERSION: ${{ steps.cassandra-version.outputs.value }}
243+
run: make test-integration-cassandra
260244

261245
- name: Copy test results
262246
if: steps.run-integration-tests.outcome == 'failure'
@@ -299,7 +283,7 @@ jobs:
299283

300284
strategy:
301285
matrix:
302-
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE]
286+
scylla-version: [LTS-LATEST, LTS-PRIOR, LATEST]
303287
java-version: [8]
304288
fail-fast: false
305289

@@ -325,29 +309,11 @@ jobs:
325309
python-version: '3.13'
326310

327311
- 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"
312+
run: sudo sh -c "echo 2097152 > /proc/sys/fs/aio-max-nr"
331313

332314
- name: Get scylla version
333315
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
316+
run: make resolve-scylla-version
351317

352318
- name: Pull CCM image from the cache
353319
uses: actions/cache/restore@v4
@@ -358,11 +324,9 @@ jobs:
358324

359325
- name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image
360326
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
327+
env:
328+
SCYLLA_VERSION=${{ matrix.scylla-version }}
329+
run: make download-scylla
366330

367331
- name: Save CCM image into the cache
368332
uses: actions/cache/save@v4
@@ -373,7 +337,9 @@ jobs:
373337

374338
- name: Run integration tests on Scylla (${{ steps.scylla-version.outputs.value }})
375339
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
340+
env:
341+
SCYLLA_VERSION_RESOLVED=${{ steps.scylla-version.outputs.value }}
342+
run: make test-integration-scylla
377343

378344
- name: Copy test results
379345
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)