Try to save CI costs #4
Workflow file for this run
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: Production databases | |
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 aws,scylladb --all-targets | |
- 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 dynamodb_local -p 8000:8000/tcp amazon/dynamodb-local | |
- name: Run DynamoDB tests | |
env: | |
AWS_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: test | |
AWS_SECRET_ACCESS_KEY: test | |
LOCALSTACK_ENDPOINT: http://localhost:8000 | |
run: | | |
cargo test --locked --features aws,scylladb -- dynamo | |
- name: Stop local DynamoDB instance | |
run: | | |
docker stop dynamodb_local | |
docker rm dynamodb_local |