diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a5401f8688..ae9a6172b3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,16 +14,12 @@ env: jobs: build: runs-on: ubuntu-latest - services: - scylladb: - image: scylladb/scylla - ports: - - 9042:9042 - options: --health-cmd "cqlsh --debug" --health-interval 5s --health-retries 10 - volumes: - - ${{ github.workspace }}:/workspace steps: - uses: actions/checkout@v2 + - name: Setup 3-node Scylla cluster + run: | + sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr" + GITHUB_WORKSPACE=${{ github.workspace }} docker-compose -f test/docker-compose.yml up -d - name: Format check run: cargo fmt --verbose --all -- --check - name: Clippy check @@ -33,7 +29,9 @@ jobs: - name: Build run: cargo build --verbose --examples - name: Run tests - run: cargo test --verbose + run: SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose + - name: Stop cluster + run: GITHUB_WORKSPACE=${{ github.workspace }} docker-compose -f test/docker-compose.yml down # Tests that our current minimum supported rust version compiles everything sucessfully min_rust: diff --git a/test/docker-compose.yml b/test/docker-compose.yml new file mode 100644 index 0000000000..4a064a88f2 --- /dev/null +++ b/test/docker-compose.yml @@ -0,0 +1,35 @@ +version: "3.7" + +networks: + public: + name: scylla_rust_driver_public + driver: bridge + ipam: + driver: default + config: + - subnet: 172.42.0.0/16 +services: + scylla1: + image: scylladb/scylla + volumes: + - ${GITHUB_WORKSPACE}:/workspace + networks: + public: + ipv4_address: 172.42.0.2 + command: --rpc-address 172.42.0.2 --listen-address 172.42.0.2 --seeds 172.42.0.2 --skip-wait-for-gossip-to-settle 0 + scylla2: + image: scylladb/scylla + volumes: + - ${GITHUB_WORKSPACE}:/workspace + networks: + public: + ipv4_address: 172.42.0.3 + command: --rpc-address 172.42.0.3 --listen-address 172.42.0.3 --seeds 172.42.0.2 --skip-wait-for-gossip-to-settle 0 + scylla3: + image: scylladb/scylla + volumes: + - ${GITHUB_WORKSPACE}:/workspace + networks: + public: + ipv4_address: 172.42.0.4 + command: --rpc-address 172.42.0.4 --listen-address 172.42.0.4 --seeds 172.42.0.2,172.42.0.3 --skip-wait-for-gossip-to-settle 0