Skip to content

refactor api

refactor api #20

Workflow file for this run

name: CI (mix test)
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-west-1
LOCALSTACK_ENDPOINT: http://localhost:4566
steps:
- name: Checkout
uses: actions/checkout@v4
# Start LocalStack (Community) as a Docker container in the runner
# - installs `awslocal` to make Command calls easy if you need them
- name: Start LocalStack
uses: LocalStack/setup-localstack@v0.2.3
with:
image-tag: 'latest'
install-awslocal: 'true'
configuration: DEBUG=1
# Set up Erlang/OTP + Elixir
- name: Set up Elixir/OTP
uses: erlef/setup-beam@v1
with:
otp-version: '26'
elixir-version: '1.17.3'
# Cache deps and _build for faster runs
- name: Cache deps
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-deps-${{ hashFiles('**/mix.lock') }}
- name: Cache _build
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }}
- name: Install deps
run: mix deps.get
- name: Compile
run: MIX_ENV=test mix compile --warnings-as-errors
# (Optional) create any LocalStack resources you need before tests
- name: Create S3 bucket with awslocal
run: |
awslocal s3api create-bucket --bucket test-bucket --region us-west-1 --create-bucket-configuration LocationConstraint=us-west-1
- name: Run tests
run: MIX_ENV=test mix test