Skip to content

Commit d3b7a1c

Browse files
authored
Merge branch 'master' into docs-setup-project
2 parents ac27d89 + 39dd81e commit d3b7a1c

File tree

94 files changed

+6103
-13734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+6103
-13734
lines changed

.clang-format

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
BasedOnStyle: LLVM
3+
Language: Cpp
4+
Standard: Cpp03
5+
AccessModifierOffset: -2
6+
IndentWidth: 2
7+
TabWidth: 8
8+
ColumnLimit: 100
9+
UseTab: Never
10+
IndentCaseLabels: true
11+
AlignAfterOpenBracket: true
12+
AlignEscapedNewlines: Left
13+
BreakConstructorInitializers: BeforeComma
14+
AllowShortBlocksOnASingleLine: false
15+
DerivePointerAlignment: false
16+
PointerAlignment: Left
17+
BinPackParameters: true
18+
BinPackArguments: true
19+
AllowShortIfStatementsOnASingleLine: true
20+
CompactNamespaces: true
21+
AlignOperands: true
22+
SpacesInContainerLiterals: true
23+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
24+
Cpp11BracedListStyle: false
25+
AlwaysBreakTemplateDeclarations: true
26+
BreakBeforeInheritanceComma: true
27+
...
28+

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
- [ ] I have split my patch into logically separate commits.
1010
- [ ] All commit messages clearly explain what they change and why.
1111
- [ ] PR description sums up the changes and reasons why they should be introduced.
12+
- [ ] I have implemented Rust unit tests for the features/changes introduced.
1213
- [ ] I have enabled appropriate tests in `.github/workflows/build.yml` in `gtest_filter`.
1314
- [ ] I have enabled appropriate tests in `.github/workflows/cassandra.yml` in `gtest_filter`.
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
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-22.04
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-22.04
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, 5.4.8]
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+
elif echo "${{ matrix.scylla-version }}" | grep -P '^[0-9\.]+'; then # If you want to run specific version do just that
89+
echo "value=${{ matrix.scylla-version }}" | tee -a $GITHUB_OUTPUT
90+
else
91+
echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
92+
exit 1
93+
fi
94+
95+
- name: Pull CCM image from the cache
96+
uses: actions/cache/restore@v4
97+
id: pull-image
98+
with:
99+
path: ~/.ccm/scylla-repository
100+
key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
101+
102+
- name: Download Scylla (${{ steps.scylla-version.outputs.value }}) image
103+
if: steps.pull-image.outputs.cache-hit != 'true'
104+
run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make download-ccm-scylla-image
105+
106+
- name: Save CCM image cache
107+
uses: actions/cache/save@v4
108+
if: steps.pull-image.outputs.cache-hit != 'true'
109+
with:
110+
path: ~/.ccm/scylla-repository
111+
key: image-scylla-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
112+
113+
- name: Pull integration test binary
114+
uses: actions/cache/restore@v4
115+
id: restore-integration-test-bin
116+
with:
117+
path: ${{ env.INTEGRATION_TEST_BIN }}
118+
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}
119+
120+
- name: Install valgrind
121+
run: make install-valgrind-if-missing
122+
123+
- name: Install binary dependencies
124+
run: make install-bin-dependencies
125+
126+
- name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }}
127+
id: run-integration-tests
128+
run: SCYLLA_VERSION="release:${{ steps.scylla-version.outputs.value }}" make run-test-integration-scylla
129+
130+
- name: Upload test logs
131+
uses: actions/upload-artifact@v4
132+
if: steps.run-integration-tests.outcome == 'failure'
133+
with:
134+
name: test-logs-scylla-${{ matrix.scylla-version }}
135+
path: ./log/*
136+
137+
- name: Upload CCM logs
138+
uses: actions/upload-artifact@v4
139+
if: failure()
140+
with:
141+
name: ccm-log-scylla-${{ matrix.scylla-version }}
142+
path: ${{ env.CCM_LOGS_PATTERN }}
143+
144+
cassandra-integration-tests:
145+
runs-on: ubuntu-22.04
146+
needs: [build-lint-and-unit-test]
147+
148+
strategy:
149+
matrix:
150+
cassandra-version: [RELEASE-3.X]
151+
java-version: [8]
152+
fail-fast: false
153+
154+
steps:
155+
- name: Checkout
156+
uses: actions/checkout@v4
157+
158+
- name: Set up JDK ${{ matrix.java-version }}
159+
uses: actions/setup-java@v4
160+
with:
161+
java-version: ${{ matrix.java-version }}
162+
distribution: 'adopt'
163+
164+
- name: Setup Python 3
165+
uses: actions/setup-python@v5
166+
with:
167+
python-version: '3.11'
168+
169+
- name: Install CCM
170+
run: make install-ccm-if-missing
171+
172+
- name: Get cassandra version
173+
id: cassandra-version
174+
run: |
175+
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
176+
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
177+
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
178+
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1 | tr -d '\"')" | tee -a $GITHUB_OUTPUT
179+
else
180+
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
181+
fi
182+
183+
- name: Pull CCM image from the cache
184+
uses: actions/cache/restore@v4
185+
id: pull-image
186+
with:
187+
path: ~/.ccm/repository
188+
key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
189+
190+
- name: Download Cassandra (${{ steps.cassandra-version.outputs.value }}) image
191+
if: steps.pull-image.outputs.cache-hit != 'true'
192+
run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make download-ccm-cassandra-image
193+
194+
- name: Save CCM image cache
195+
uses: actions/cache/save@v4
196+
if: steps.pull-image.outputs.cache-hit != 'true'
197+
with:
198+
path: ~/.ccm/repository
199+
key: image-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
200+
201+
- name: Pull integration test binary
202+
uses: actions/cache/restore@v4
203+
id: restore-integration-test-bin
204+
with:
205+
path: ${{ env.INTEGRATION_TEST_BIN }}
206+
key: ${{ env.INTEGRATION_TEST_BIN_CACHE_KEY }}
207+
208+
- name: Install valgrind
209+
run: make install-valgrind-if-missing
210+
211+
- name: Install binary dependencies
212+
run: make install-bin-dependencies
213+
214+
- name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }}
215+
id: run-integration-tests
216+
run: CASSANDRA_VERSION="${{ steps.cassandra-version.outputs.value }}" make run-test-integration-cassandra
217+
218+
- name: Upload test logs
219+
uses: actions/upload-artifact@v4
220+
if: steps.run-integration-tests.outcome == 'failure'
221+
with:
222+
name: test-logs-cassandra-${{ matrix.cassandra-version }}
223+
path: ./log/*
224+
225+
- name: Upload CCM logs
226+
uses: actions/upload-artifact@v4
227+
if: failure()
228+
with:
229+
name: ccm-log-cassandra-${{ matrix.java-version }}-${{ matrix.cassandra-version }}
230+
path: ${{ env.CCM_LOGS_PATTERN }}

.github/workflows/build.yml

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

.github/workflows/cargo_check.yml

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

0 commit comments

Comments
 (0)