ci: replace gitlab ci with gitea workflow running pytest and prek

This commit is contained in:
ponas committed 2026-11-03 03:52:46 +01:00
1 parent 5474ad7bdc
commit a21b4c9417
2 files changed
+34 -19

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
name: CI
# Tests and prek on every push and pull request.
on:
push:
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mise
run: |
curl -fsSL https://mise.run | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Install pinned tools
run: mise install
# The prod group needs MySQL headers; tests run on SQLite.
- name: Install Python dependencies
run: mise exec -- uv sync --locked --no-group prod
- name: Unit tests
run: mise exec -- uv run --no-sync pytest
# The hooks in prek.toml.
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: j178/prek-action@v1
-19
View File
@@ -1,19 +0,0 @@
image: python:latest
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
cache:
paths:
- "$CI_PROJECT_DIR/pip-cache"
key: "$CI_PROJECT_ID"
before_script:
- pip install -r requirements.txt
- pip install coverage
test:
script:
- coverage run --source=dpdapi --omit=dpdapi/migrations/* manage.py test -v2
- coverage report
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'