/ .github / workflows / tests.yml
tests.yml
 1  name: Tests
 2  
 3  on:
 4    push:
 5      branches: [master, beta]
 6    pull_request:
 7      branches: [master, beta]
 8  
 9  permissions:
10    contents: read
11    checks: write
12  
13  jobs:
14    test:
15      runs-on: ubuntu-latest
16  
17      steps:
18        - uses: actions/checkout@v4
19  
20        - uses: astral-sh/setup-uv@v5
21          with:
22            python-version: "3.12"
23  
24        - name: Create frontend build placeholder
25          run: mkdir -p frontend/build && echo '<!doctype html>' > frontend/build/index.html
26  
27        - name: Install dependencies
28          run: uv sync --no-group gpu
29  
30        - name: Initialize database
31          run: uv run --no-group gpu python database.py
32  
33        - name: Run tests
34          run: uv run --no-group gpu pytest tests/ -v --tb=short --ignore=tests/test_projects.py --junitxml=test-results.xml
35  
36        - name: Test Report
37          uses: dorny/test-reporter@v1
38          if: always()
39          with:
40            name: Tests
41            path: test-results.xml
42            reporter: java-junit
43  
44        - uses: actions/setup-node@v4
45          with:
46            node-version: "20"
47  
48        - name: Build frontend
49          env:
50            CI: false
51          run: cd frontend && npm ci && npm run build