Some checks failed
Backend Tests / pytest (Python 3.12) (push) Has been cancelled
- get_vm_status and get_container_status were missing require_vm_access(), allowing any user with vms.view to see any VM status regardless of ownership. Now users with vms.view.own can only access their own VMs (403 otherwise). - Downgrade upload-artifact@v4 → @v3: v4 is not supported on Gitea (GHES) and caused CI failures on every run. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: Backend Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/workflows/backend-tests.yml"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/workflows/backend-tests.yml"
|
|
|
|
jobs:
|
|
pytest:
|
|
name: pytest (Python ${{ matrix.python-version }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.12"]
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: pip
|
|
cache-dependency-path: backend/requirements-dev.txt
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Run pytest with coverage
|
|
run: |
|
|
python -m pytest \
|
|
--cov=app \
|
|
--cov-report=term-missing \
|
|
--cov-report=xml \
|
|
-p no:warnings
|
|
|
|
- name: Upload coverage artifact
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: backend-coverage-${{ matrix.python-version }}
|
|
path: backend/coverage.xml
|
|
if-no-files-found: ignore
|