59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
backend-tests:
|
|
name: Backend tests
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DJANGO_SECRET_KEY: ci-test-key
|
|
DJANGO_DEBUG: "0"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip"
|
|
cache-dependency-path: |
|
|
backend/requirements.txt
|
|
backend/requirements-dev.txt
|
|
|
|
- name: Install backend dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -r backend/requirements.txt -r backend/requirements-dev.txt
|
|
|
|
- name: Run backend tests
|
|
working-directory: backend
|
|
run: python -m pytest
|
|
|
|
frontend-tests:
|
|
name: Frontend tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: frontend/package-lock.json
|
|
|
|
- name: Install frontend dependencies
|
|
working-directory: frontend
|
|
run: npm ci
|
|
|
|
- name: Run frontend tests
|
|
working-directory: frontend
|
|
env:
|
|
CI: "true"
|
|
run: npm run test -- --run
|