Skip to content

Added Makefile command to create table and adjusted ci.yaml to use Ma… #6

Added Makefile command to create table and adjusted ci.yaml to use Ma…

Added Makefile command to create table and adjusted ci.yaml to use Ma… #6

Workflow file for this run

name: CI
on: [push, pull_request]
env:
POETRY_HOME: /home/runner/.local
POETRY_CACHE_DIR: /home/runner/.local/.cache
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_DEFAULT_REGION: us-east-1
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v4
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: make install-packages
- name: Run mypy
run: make lint
- name: Start local dynamodb
run: make docker-up
- name: Create dynamodb table
run: |
sleep 3 # Lazy
make create-table
# aws dynamodb create-table \
# --endpoint-url http://localhost:8000 \
# --table-name dynamo_events \
# --attribute-definitions \
# AttributeName=originator_id,AttributeType=S \
# AttributeName=originator_version,AttributeType=N \
# --key-schema AttributeName=originator_id,KeyType=HASH AttributeName=originator_version,KeyType=RANGE \
# --billing-mode PAY_PER_REQUEST \
# --no-cli-pager
- name: Run tests
run: make test
# run: poetry run pytest -v