ah jeez #438
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['develop'] | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
- closed | |
# Interestingly... defining env vars here is broken... | |
# https://github.com/maxplanck-ie/parkour2/actions/runs/5457117039/workflow | |
jobs: | |
install-per-wiki-instructions: | |
if: github.repository == 'maxplanck-ie/parkour2' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Follow instructions | |
run: | | |
make | |
make create-admin | |
build-and-test: | |
if: github.repository == 'maxplanck-ie/parkour2' | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9, '3.10', 3.11] | |
services: | |
postgres: | |
env: | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
image: postgres:latest | |
ports: | |
- 5432/tcp | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r parkour_app/requirements/prod.txt | |
- name: Verify migrations | |
env: | |
DJANGO_SETTINGS_MODULE: wui.settings.prod | |
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python parkour_app/manage.py makemigrations --no-input --check --dry-run | |
- name: Validate templates | |
env: | |
DJANGO_SETTINGS_MODULE: wui.settings.prod | |
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python parkour_app/manage.py validate_templates | |
- name: Run unittests | |
env: | |
DJANGO_SETTINGS_MODULE: wui.settings.prod | |
DATABASE_URL: postgres://postgres:${{ secrets.POSTGRES_PASSWORD }}@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python parkour_app/manage.py test parkour_app --parallel | |