ci(gitea): add offline-friendly test workflows and deploy on bt
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
44
.gitea/workflows/test-backend.yml
Normal file
44
.gitea/workflows/test-backend.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
name: Test Backend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- bt
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
test-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout and run backend tests
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export PATH="${HOME}/.local/bin:${PATH}"
|
||||
export UV_PYTHON_DOWNLOADS=automatic
|
||||
|
||||
git clone "http://172.17.0.1:3000/${{ github.repository }}.git" .
|
||||
git checkout "${{ github.sha }}"
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y python3 python3-pip python3-venv ca-certificates
|
||||
|
||||
python3 -m pip install --user --upgrade pip
|
||||
python3 -m pip install --user "uv>=0.4"
|
||||
|
||||
docker compose down -v --remove-orphans || true
|
||||
docker compose up -d db mailcatcher
|
||||
|
||||
(cd backend && uv run bash scripts/prestart.sh)
|
||||
(cd backend && uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}")
|
||||
|
||||
docker compose down -v --remove-orphans || true
|
||||
|
||||
if [ -d backend/htmlcov ]; then
|
||||
echo "Coverage HTML generated under backend/htmlcov (view on runner if needed)."
|
||||
fi
|
||||
|
||||
(cd backend && uv run coverage report --fail-under=90)
|
||||
Reference in New Issue
Block a user