Add pytest suite and CI test gate
This commit is contained in:
@@ -9,7 +9,41 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mariadb:
|
||||
image: mariadb:11
|
||||
env:
|
||||
MARIADB_DATABASE: jellomator_test
|
||||
MARIADB_USER: jellomator
|
||||
MARIADB_PASSWORD: jellomator
|
||||
MARIADB_ROOT_PASSWORD: root
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: >-
|
||||
--health-cmd="mariadb-admin ping -h 127.0.0.1 -uroot -proot"
|
||||
--health-interval=5s
|
||||
--health-timeout=5s
|
||||
--health-retries=20
|
||||
env:
|
||||
DB_HOST: 127.0.0.1
|
||||
DB_PORT: "3306"
|
||||
DB_USER: jellomator
|
||||
DB_PASSWORD: jellomator
|
||||
DB_NAME: jellomator_test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Install Python dependencies
|
||||
run: pip install -r backend/requirements-dev.txt
|
||||
- name: Run backend tests
|
||||
run: pytest -q
|
||||
|
||||
build-and-push:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user