Skip to content

Commit 1a17e38

Browse files
authored
Merge pull request #159 from scylladb/dk/redo-cicd
ci: redo cicd
2 parents 24fd7d1 + 607eca0 commit 1a17e38

File tree

9 files changed

+633
-196
lines changed

9 files changed

+633
-196
lines changed
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
# Should include `INTEGRATION_TEST_BIN` from the `Makefile`
12+
# TODO: Remove `build/libscylla-cpp-driver.*` after https://github.com/scylladb/cpp-rust-driver/issues/164 is fixed.
13+
INTEGRATION_TEST_BIN: |
14+
build/cassandra-integration-tests
15+
build/libscylla-cpp-driver.*
16+
INTEGRATION_TEST_BIN_CACHE_KEY: integration-test-bin-${{ github.sha }}
17+
# Goes to `Makefile` to let it pickup cached binary
18+
DONT_REBUILD_INTEGRATION_BIN: true
19+
CCM_LOGS_PATTERN: /tmp/ccm*/ccm*/node*/logs/*
20+
21+
jobs:
22+
build-lint-and-unit-test:
23+
name: Build, lint and run unit tests
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Install dependencies
30+
run: make install-build-dependencies
31+
32+
- name: Check
33+
run: make check
34+
35+
- name: Run unit and proxy tests
36+
run: make run-test-unit
37+
38+
- name: Build integration test binary
39+
id: build-integration-test-bin
40+
run: make build-integration-test-bin
41+
42+
- name: Save integration test binary
43+
uses: actions/cache/save@v4
44+
id: save-integration-test-bin
45+
with:
46+
path: ${{ env.INTEGRATION_TEST_BIN }}
47+
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}
48+
49+
scylla-integration-tests:
50+
name: Scylla ITs
51+
runs-on: ubuntu-latest
52+
needs: [build-lint-and-unit-test]
53+
timeout-minutes: 90
54+
55+
strategy:
56+
matrix:
57+
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE]
58+
fail-fast: false
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Setup Python 3
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: '3.11'
68+
69+
- name: Install CCM
70+
run: |
71+
make install-ccm-if-missing
72+
73+
- name: Get scylla version
74+
id: scylla-version
75+
run: |
76+
if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
77+
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
78+
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then
79+
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
80+
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then
81+
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT
82+
elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
83+
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
84+
elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then
85+
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
86+
elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then
87+
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc | tr -d '\"')" | tee -a $GITHUB_OUTPUT
88+
else
89+
echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
90+
exit 1
91+
fi
92+
93+
- name: Pull CCM image from the cache
94+
uses: actions/cache/restore@v4
95+
id: pull-image
96+
with:
97+
path: ~/.ccm/scylla-repository
98+
key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
99+
100+
- name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image
101+
if: steps.pull-image.outputs.cache-hit != 'true'
102+
run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make download-ccm-scylla-image
103+
104+
- name: Save CCM image cache
105+
uses: actions/cache/save@v4
106+
if: steps.pull-image.outputs.cache-hit != 'true'
107+
with:
108+
path: ~/.ccm/scylla-repository
109+
key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
110+
111+
- name: Pull integration test binary
112+
uses: actions/cache/restore@v4
113+
id: restore-integration-test-bin
114+
with:
115+
path: ${{ env.INTEGRATION_TEST_BIN }}
116+
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}
117+
118+
- name: Install valgrind
119+
run: make install-valgrind-if-missing
120+
121+
- name: Install binary dependencies
122+
run: make install-bin-dependencies
123+
124+
- name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }}
125+
id: run-integration-tests
126+
run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make run-test-integration-scylla
127+
128+
- name: Upload test logs
129+
uses: actions/upload-artifact@v4
130+
if: steps.run-integration-tests.outcome == 'failure'
131+
with:
132+
name: test-logs-scylla-${{ matrix.scylla-version }}
133+
path: ./log/*
134+
135+
- name: Upload CCM logs
136+
uses: actions/upload-artifact@v4
137+
if: failure()
138+
with:
139+
name: ccm-log-scylla-${{ matrix.scylla-version }}
140+
path: ${{ env.CCM_LOGS_PATTERN }}
141+
142+
cassandra-integration-tests:
143+
runs-on: ubuntu-latest
144+
needs: [build-lint-and-unit-test]
145+
146+
strategy:
147+
matrix:
148+
cassandra-version: [RELEASE-3.X]
149+
java-version: [8]
150+
fail-fast: false
151+
152+
steps:
153+
- name: Checkout
154+
uses: actions/checkout@v4
155+
156+
- name: Set up JDK ${{ matrix.java-version }}
157+
uses: actions/setup-java@v4
158+
with:
159+
java-version: ${{ matrix.java-version }}
160+
distribution: 'adopt'
161+
162+
- name: Setup Python 3
163+
uses: actions/setup-python@v5
164+
with:
165+
python-version: '3.11'
166+
167+
- name: Install CCM
168+
run: make install-ccm-if-missing
169+
170+
- name: Get cassandra version
171+
id: cassandra-version
172+
run: |
173+
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
174+
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
175+
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
176+
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
177+
else
178+
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
179+
fi
180+
181+
- name: Pull CCM image from the cache
182+
uses: actions/cache/restore@v4
183+
id: pull-image
184+
with:
185+
path: ~/.ccm/repository
186+
key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
187+
188+
- name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
189+
if: steps.pull-image.outputs.cache-hit != 'true'
190+
run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make download-ccm-cassandra-image
191+
192+
- name: Save CCM image cache
193+
uses: actions/cache/save@v4
194+
if: steps.pull-image.outputs.cache-hit != 'true'
195+
with:
196+
path: ~/.ccm/repository
197+
key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
198+
199+
- name: Pull integration test binary
200+
uses: actions/cache/restore@v4
201+
id: restore-integration-test-bin
202+
with:
203+
path: ${{ env.INTEGRATION_TEST_BIN }}
204+
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}
205+
206+
- name: Install valgrind
207+
run: make install-valgrind-if-missing
208+
209+
- name: Install binary dependencies
210+
run: make install-bin-dependencies
211+
212+
- name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }}
213+
id: run-integration-tests
214+
run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make run-test-integration-cassandra
215+
216+
- name: Upload test logs
217+
uses: actions/upload-artifact@v4
218+
if: steps.run-integration-tests.outcome == 'failure'
219+
with:
220+
name: test-logs-cassandra-${{ matrix.cassandra-version }}
221+
path: ./log/*
222+
223+
- name: Upload CCM logs
224+
uses: actions/upload-artifact@v4
225+
if: failure()
226+
with:
227+
name: ccm-log-cassandra-${{ matrix.java-version }}-${{ matrix.cassandra-version }}
228+
path: ${{ env.CCM_LOGS_PATTERN }}

.github/workflows/build.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/cargo_check.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/cassandra.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)