Add test CI Action with multiple 🐍 versions (#57)

This commit is contained in:
Michael Plunkett
2025-02-26 14:37:49 -06:00
committed by GitHub
parent 7e48f706df
commit 229db7dd5c
5 changed files with 44 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ on:
branches: [ main, dev ]
jobs:
test:
test-with-coverage:
runs-on: ubuntu-latest
services:

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.0

40
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Run Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
services:
redis:
image: redis:6-alpine
ports:
- 6379:6379
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Install dependencies
run: poetry install --no-interaction --with dev
- name: Set dev environment variable
run: echo "ENVIRONMENT_FILE=.env.test" >> $GITHUB_ENV
- name: Run tests
run: poetry run pytest app/tests

0
app/__init__.py Normal file
View File

2
pytest.ini Normal file
View File

@@ -0,0 +1,2 @@
[pytest]
pythonpath = .