Files
dibbler/.gitea/workflows/test.yaml
h7x4 6cf558f793
Some checks failed
Run tests / run-tests (push) Has been cancelled
fixup! WIP
2025-12-08 20:17:00 +09:00

51 lines
1.2 KiB
YAML

name: Run tests
on:
pull_request:
push:
workflow_dispatch:
inputs:
debug_sqlalchemy:
description: "Print SQL statements executed by SQLAlchemy during tests"
type: boolean
default: false
jobs:
run-tests:
runs-on: debian-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --locked
- name: Run tests
run: |
PYTEST_ARGS=(
--cov=dibbler
--cov-report=html
--cov-branch
)
if [ "${{ inputs.debug_sqlalchemy }}" == "true" ]; then
PYTEST_ARGS+=(
--echo
)
fi
uv run -- pytest --cov=dibbler --cov-report=html
- name: Generate badge
run: uvx coverage-badge -o htmlcov/badge.svg
- name: Upload coverage report
uses: https://git.pvv.ntnu.no/Projects/rsync-action@v1
with:
source: ./htmlcov/
target: ${{ gitea.ref_name }}/coverage/
username: gitea-web
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
host: pages.pvv.ntnu.no
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"