Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
id: cp312
with:
python-version-file: ".python-version"
cache: "pip"
cache-dependency-path: "requirements-test.txt"

# for testing
- name: Check cache hit
run: echo "${{ steps.cp312.outputs.cache-hit }}" # true if cache-hit occurred on the primary key

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt

- name: Run tests
run: |
pytest --disable-warnings -q -rA
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# TODO: Fix hack. Changes the env var before initializing the db for testing
os.environ["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
os.environ["JWT_SECRET_KEY"] = os.urandom(24).hex()

from app import app, db

Expand Down