From f8b8c30cec59aad7e8f523966910e01e5f972a9e Mon Sep 17 00:00:00 2001 From: Mathieu Baudet <1105398+ma2bd@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:20:49 -0700 Subject: [PATCH] merge ScyllaDb and DynamoDb tests --- .../workflows/{dynamodb.yml => databases.yml} | 22 ++++++-- .github/workflows/scylladb.yml | 56 ------------------- 2 files changed, 18 insertions(+), 60 deletions(-) rename .github/workflows/{dynamodb.yml => databases.yml} (66%) delete mode 100644 .github/workflows/scylladb.yml diff --git a/.github/workflows/dynamodb.yml b/.github/workflows/databases.yml similarity index 66% rename from .github/workflows/dynamodb.yml rename to .github/workflows/databases.yml index 25e4554ff316..60b9a865da1d 100644 --- a/.github/workflows/dynamodb.yml +++ b/.github/workflows/databases.yml @@ -1,4 +1,4 @@ -name: DynamoDB tests +name: Production databases on: push: @@ -47,10 +47,20 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build run: | - cargo build --locked --features aws + cargo build --locked --features aws,scylladb + - name: Setup local ScyllaDB instance + run: | + docker run --name scylladb -d -p 9042:9042 scylladb/scylla + - name: Run ScyllaDB tests + run: | + cargo test --locked --features aws,scylladb -- scylla + - name: Stop local ScyllaDB instance + run: | + docker stop scylladb + docker rm scylladb - name: Setup local DynamoDB instance run: | - docker run --rm -d --name local-dynamodb -p 8000:8000/tcp amazon/dynamodb-local + docker run --rm -d --name dynamodb_local -p 8000:8000/tcp amazon/dynamodb-local - name: Run DynamoDB tests env: AWS_REGION: us-east-1 @@ -58,4 +68,8 @@ jobs: AWS_SECRET_ACCESS_KEY: test LOCALSTACK_ENDPOINT: http://localhost:8000 run: | - cargo test --locked --features aws -- dynamo + cargo test --locked --features aws,scylladb -- dynamo + - name: Stop local DynamoDB instance + run: | + docker stop dynamodb_local + docker rm dynamodb_local diff --git a/.github/workflows/scylladb.yml b/.github/workflows/scylladb.yml deleted file mode 100644 index b7f40640ea13..000000000000 --- a/.github/workflows/scylladb.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: ScyllaDB tests - -on: - push: - branches: [ main ] - pull_request: - branches: - - "**" - paths-ignore: - - 'CONTRIBUTING.md' - - 'INSTALL.md' - - 'docker/**' - - 'kubernetes/**' - workflow_dispatch: - -# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' - cancel-in-progress: true - -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - CARGO_NET_RETRY: 10 - RUST_BACKTRACE: short - RUSTFLAGS: "-D warnings" - RUSTUP_MAX_RETRIES: 10 - RUST_LOG: warn - -permissions: - contents: read - -jobs: - - build: - runs-on: ubuntu-latest-16-cores - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build - run: | - cargo build --locked --features scylladb - - name: Setup local ScyllaDB instance - run: | - docker run --name my_scylla_container -d -p 9042:9042 scylladb/scylla - - name: Run ScyllaDB tests - run: | - cargo test --locked --features scylladb -- scylla