Skip to content

Commit

Permalink
ci: redo cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
dkropachev committed Sep 5, 2024
1 parent 7fc403b commit 6a461fa
Show file tree
Hide file tree
Showing 6 changed files with 432 additions and 120 deletions.
220 changes: 220 additions & 0 deletions .github/workflows/build-lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
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: Build
run: cmake -DCASS_BUILD_INTEGRATION_TESTS=ON . && make

- 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: |
sudo apt-get update
sudo apt-get install libssl1.1 libuv1-dev libkrb5-dev libc6-dbg
sudo snap install valgrind --classic
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: 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
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@v2
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.scylla-version.outputs.value }}

- name: Run integration tests on Cassandra 4.0.7
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-scylla
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/*
63 changes: 0 additions & 63 deletions .github/workflows/build.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/cargo_check.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/clippy.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/format.yml

This file was deleted.

Loading

0 comments on commit 6a461fa

Please sign in to comment.