Skip to content

Add API Gateway Local setup #207

Add API Gateway Local setup

Add API Gateway Local setup #207

Workflow file for this run

# This is the main CI workflow that runs the test suite on all pushes to main and all pull requests.
# It runs the following jobs:
# - required: runs the test suite on ubuntu with stable and beta rust toolchains
# - minimal: runs the test suite with the minimal versions of the dependencies that satisfy the
# requirements of this crate, and its dependencies
# - os-check: runs the test suite on mac and windows
# - coverage: runs the test suite and collects coverage information
# See check.yml for information about how the concurrency cancellation and workflow triggering works
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
paths:
- 'server/**'
- '.github/workflows/test.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: server / test
jobs:
required:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }}
defaults:
run:
working-directory: ./server
strategy:
matrix:
# run on stable and beta to ensure that tests won't break on the next version of the rust
# toolchain
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('server/Cargo.lock') == ''
run: cargo generate-lockfile
- name: Download DynamoDB Local
run: |
wget https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz
wget https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz.sha256
sha256sum --check dynamodb_local_latest.tar.gz.sha256
mkdir dynamodb-local
tar xfv dynamodb_local_latest.tar.gz --directory=dynamodb-local
ls -lah dynamodb-local
- name: Install Java SDK
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
- name: Launch DynamoDB Local
run: |
cd dynamodb-local
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb &
- name: Create tables and indexes in DynamoDb Local
run: ./run-migrations.sh http://localhost:8000
env:
AWS_ACCESS_KEY_ID: carpe
AWS_SECRET_ACCESS_KEY: diem
AWS_DEFAULT_REGION: dead-poets-society-eu-east-1
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
run: cargo test --locked --all-features --all-targets -- --include-ignored
env:
USE_DYNAMODB: local