ci: redo cicd #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-lint-and-unit-test: | |
name: Build, lint and run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libssl1.1 libuv1-dev libkrb5-dev libc6-dbg | |
- name: Build integration suit | |
run: cmake -DCASS_BUILD_INTEGRATION_TESTS=ON . && make | |
- name: Save integration test binary | |
uses: actions/cache/save@v4 | |
id: save-integration-test-bin | |
with: | |
path: cassandra-integration-tests | |
key: integration-test-bin-${{ github.sha }} | |
- name: Cargo check | |
working-directory: ./scylla-rust-wrapper | |
run: cargo check | |
- name: Cargo clippy check | |
working-directory: ./scylla-rust-wrapper | |
run: cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args | |
- name: Cargo format check | |
working-directory: ./scylla-rust-wrapper | |
run: cargo fmt --verbose --all -- --check | |
- name: Run unit and proxy tests | |
working-directory: ./scylla-rust-wrapper | |
run: cargo test | |
setup-integration-tests: | |
name: Setup ITs | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Setup environment | |
run: | | |
pip3 install https://github.com/scylladb/scylla-ccm/archive/a93125bc6ad7dd5c9694331e89dc1fb212431ffe.zip | |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr" | |
scylla-integration-tests: | |
name: Scylla ITs | |
runs-on: ubuntu-latest | |
needs: [setup-integration-tests] | |
timeout-minutes: 90 | |
strategy: | |
matrix: | |
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE] | |
fail-fast: false | |
steps: | |
- name: Get scylla version | |
id: scylla-version | |
run: | | |
if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc)" >> $GITHUB_OUTPUT | |
else | |
echo "Unknown scylla version name `${{ matrix.scylla-version }}`" | |
exit 1 | |
fi | |
- name: Restore CCM image cache | |
uses: actions/cache/restore@v4 | |
id: ccm-cache | |
with: | |
path: ~/.ccm/repository | |
key: ccm-cassandra-${{ runner.os }}-${{ steps.scylla-version.outputs.value }} | |
- name: Restore integration test binary | |
uses: actions/cache/restore@v4 | |
id: restore-integration-test-bin | |
with: | |
path: cassandra-integration-tests | |
key: integration-test-bin-${{ github.sha }} | |
- name: Install valgrind | |
run: | | |
sudo snap install valgrind --classic | |
- name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }} | |
env: | |
# Ignored tests are added in the end, after the "-" sign. | |
Tests: "ClusterTests.*\ | |
:BasicsTests.*\ | |
:PreparedTests.*\ | |
:CassandraTypes/CassandraTypesTests/*.Integration_Cassandra_*\ | |
:BatchSingleNodeClusterTests*:BatchCounterSingleNodeClusterTests*:BatchCounterThreeNodeClusterTests*\ | |
:ErrorTests.*\ | |
:SslNoClusterTests*:SslNoSslOnClusterTests*\ | |
:SchemaMetadataTest.*KeyspaceMetadata:SchemaMetadataTest.*MetadataIterator:SchemaMetadataTest.*View*\ | |
:TracingTests.*\ | |
:ByNameTests.*\ | |
:CompressionTests.*\ | |
:LoggingTests.*\ | |
:-PreparedTests.Integration_Cassandra_PreparedIDUnchangedDuringReprepare\ | |
:ExecutionProfileTest.InvalidName" | |
run: valgrind --error-exitcode=123 --leak-check=full --errors-for-leak-kinds=definite ./cassandra-integration-tests --scylla --version=release:5.0.0 --category=CASSANDRA --verbose=ccm --gtest_filter="$Tests" | |
- name: Save CCM image cache | |
uses: actions/cache/save@v4 | |
if: steps.ccm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ~/.ccm/repository | |
key: ccm-cassandra-${{ runner.os }}-${{ steps.scylla-version.outputs.value }} | |
- name: Upload test logs | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: test-logs-scylla-${{ matrix.cassandra-version }} | |
path: ./log/* | |
- name: Upload CCM logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ccm-log-scylla-${{ matrix.scylla-version }} | |
path: /tmp/ccm*/ccm*/node*/logs/* | |
cassandra-integration-tests: | |
runs-on: ubuntu-latest | |
needs: [setup-integration-tests] | |
strategy: | |
matrix: | |
cassandra-version: [RELEASE-3.X, RELEASE-4.X] | |
java-version: [8] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'adopt' | |
- name: Get cassandra version | |
id: cassandra-version | |
run: | | |
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1)" >> $GITHUB_OUTPUT | |
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then | |
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1)" >> $GITHUB_OUTPUT | |
else | |
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`" | |
fi | |
- name: Restore CCM image cache | |
uses: actions/cache/restore@v4 | |
id: ccm-cache | |
with: | |
path: ~/.ccm/repository | |
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }} | |
- name: Restore integration test binary | |
uses: actions/cache/restore@v4 | |
id: restore-integration-test-bin | |
with: | |
path: cassandra-integration-tests | |
key: integration-test-bin-${{ github.sha }} | |
- name: Install valgrind | |
run: | | |
sudo snap install valgrind --classic | |
- name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }} | |
env: | |
# Ignored tests are added in the end, after the "-" sign. | |
Tests: "ClusterTests.*\ | |
:BasicsTests.*\ | |
:PreparedTests.*\ | |
:CassandraTypes/CassandraTypesTests/*.Integration_Cassandra_*\ | |
:ErrorTests.*\ | |
:SslClientAuthenticationTests*:SslNoClusterTests*:SslNoSslOnClusterTests*:SslTests*\ | |
:SchemaMetadataTest.*KeyspaceMetadata:SchemaMetadataTest.*MetadataIterator:SchemaMetadataTest.*View*\ | |
:TracingTests.*\ | |
:ByNameTests.*\ | |
:CompressionTests.*\ | |
:LoggingTests.*\ | |
:-PreparedTests.Integration_Cassandra_PreparedIDUnchangedDuringReprepare\ | |
:PreparedTests.Integration_Cassandra_FailFastWhenPreparedIDChangesDuringReprepare\ | |
:SslTests.Integration_Cassandra_ReconnectAfterClusterCrashAndRestart\ | |
:ExecutionProfileTest.InvalidName\ | |
:*NoCompactEnabledConnection" | |
run: valgrind --error-exitcode=123 --leak-check=full --errors-for-leak-kinds=definite ./cassandra-integration-tests --version=4.0.7 --category=CASSANDRA --verbose=ccm --gtest_filter="$Tests" | |
- name: Save CCM image cache | |
uses: actions/cache/save@v4 | |
if: steps.ccm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ~/.ccm/repository | |
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }} | |
- name: Upload test logs | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: test-logs-cassandra-${{ matrix.cassandra-version }} | |
path: ./log/* | |
- name: Upload CCM logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ccm-log-cassandra-${{ matrix.java-version }}-${{ matrix.cassandra-version }} | |
path: /tmp/ccm*/ccm*/node*/logs/* |