Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Test Suite

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb \
scrot \
xdotool \
freerdp2-x11 \
imagemagick \
x11-utils \
libgl1-mesa-glx \
libglib2.0-0

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Install dependencies
run: |
uv sync --all-groups

- name: Lint with ruff
run: |
uv run ruff check src/ tests/

- name: Format check with ruff
run: |
uv run ruff format --check src/ tests/

- name: Type check with pyright
run: |
uv run pyright src/

- name: Run unit tests
run: |
uv run python -m pytest tests/unit/ \
--cov=src \
--cov-report=xml \
--cov-report=term-missing \
--cov-fail-under=70 \
-v

- name: Run integration tests (mock only)
run: |
uv run python -m pytest tests/integration/ \
-m "mock and not real_vm" \
--cov=src \
--cov-append \
--cov-report=xml \
--cov-report=term-missing \
-v
if: success() || failure()

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ matrix.python-version }}
path: |
htmlcov/
coverage.xml
.coverage

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: uv sync --group dev

- name: Run security scan with bandit
run: |
uv add bandit[toml]
uv run bandit -r src/ -f json -o bandit-report.json
continue-on-error: true

- name: Upload security scan results
uses: actions/upload-artifact@v3
if: always()
with:
name: security-scan-results
path: bandit-report.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ build/

# Coverage
.coverage*
coverage.xml
htmlcov/

# OS / IDE
Expand Down
Loading
Loading