2025-06-20 14:47:12 +02:00
|
|
|
name: Django Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ["*"]
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
2025-06-20 14:53:27 +02:00
|
|
|
container: catthehacker/ubuntu:act-latest
|
|
|
|
|
2025-06-20 14:47:12 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2025-06-20 14:50:34 +02:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Build Docker image (local only)
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: false
|
2025-06-20 14:57:41 +02:00
|
|
|
load: true
|
2025-06-20 14:50:34 +02:00
|
|
|
tags: website:test
|
|
|
|
|
|
|
|
- name: Run Django tests in container
|
2025-06-20 14:47:12 +02:00
|
|
|
run: |
|
2025-06-20 14:50:34 +02:00
|
|
|
docker run --rm \
|
|
|
|
-w /app \
|
2025-06-20 15:06:01 +02:00
|
|
|
-e SECRET_KEY=dummysecretkey \
|
2025-06-20 14:50:34 +02:00
|
|
|
website:test \
|
2025-06-20 15:10:43 +02:00
|
|
|
sh -c 'uv run --extra dev manage.py migrate --noinput && uv run --extra dev manage.py test hub.services.tests --verbosity=2'
|