Compare commits
1 Commits
5d50401d40
...
bt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ca0834b76 |
@@ -1,98 +0,0 @@
|
|||||||
name: Playwright Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- bt
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-playwright:
|
|
||||||
timeout-minutes: 60
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
git clone "http://172.17.0.1:3000/${{ github.repository }}.git" .
|
|
||||||
git checkout "${{ github.sha }}"
|
|
||||||
|
|
||||||
- name: Detect relevant file changes
|
|
||||||
id: changes
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
CHANGED=false
|
|
||||||
|
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
|
||||||
BASE="${{ github.base_ref }}"
|
|
||||||
git fetch origin "+refs/heads/${BASE}:refs/remotes/origin/${BASE}" --depth=200 2>/dev/null \
|
|
||||||
|| git fetch origin --depth=200
|
|
||||||
if git rev-parse "origin/${BASE}" >/dev/null 2>&1; then
|
|
||||||
FILES=$(git diff --name-only "origin/${BASE}...HEAD" || true)
|
|
||||||
else
|
|
||||||
FILES=$(git show --name-only --pretty=format: HEAD)
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
BEFORE="${{ github.event.before }}"
|
|
||||||
if [ -z "${BEFORE}" ] || [ "${BEFORE}" = "0000000000000000000000000000000000000000" ]; then
|
|
||||||
FILES=$(git show --name-only --pretty=format: HEAD)
|
|
||||||
else
|
|
||||||
FILES=$(git diff --name-only "${BEFORE}" "${{ github.sha }}" || true)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
while IFS= read -r line; do
|
|
||||||
[ -z "${line}" ] && continue
|
|
||||||
case "${line}" in
|
|
||||||
backend/*|frontend/*|.env|compose*|.gitea/workflows/playwright.yml|.github/workflows/playwright.yml)
|
|
||||||
CHANGED=true
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done <<< "${FILES}"
|
|
||||||
|
|
||||||
echo "changed=${CHANGED}" >> "${GITHUB_OUTPUT}"
|
|
||||||
echo "Relevant changes for Playwright: ${CHANGED}"
|
|
||||||
|
|
||||||
- name: Skip Playwright (no relevant changes)
|
|
||||||
if: steps.changes.outputs.changed != 'true'
|
|
||||||
run: echo "Skipping Playwright — no changes under backend/, frontend/, compose, .env, or playwright workflows."
|
|
||||||
|
|
||||||
- name: Install uv and Bun
|
|
||||||
if: steps.changes.outputs.changed == 'true'
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
export PATH="${HOME}/.local/bin:${HOME}/.bun/bin:${PATH}"
|
|
||||||
export UV_PYTHON_DOWNLOADS=automatic
|
|
||||||
|
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -y python3 python3-pip python3-venv curl unzip ca-certificates
|
|
||||||
|
|
||||||
python3 -m pip install --user --upgrade pip
|
|
||||||
python3 -m pip install --user "uv>=0.4"
|
|
||||||
|
|
||||||
# Official Bun installer (not GitHub Actions)
|
|
||||||
curl -fsSL https://bun.sh/install | bash
|
|
||||||
|
|
||||||
- name: Generate client, build images, run Playwright
|
|
||||||
if: steps.changes.outputs.changed == 'true'
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
export PATH="${HOME}/.local/bin:${HOME}/.bun/bin:${PATH}"
|
|
||||||
export BUN_INSTALL="${HOME}/.bun"
|
|
||||||
|
|
||||||
(cd backend && uv sync)
|
|
||||||
bun ci
|
|
||||||
bash scripts/generate-client.sh
|
|
||||||
|
|
||||||
docker compose build
|
|
||||||
docker compose down -v --remove-orphans || true
|
|
||||||
docker compose run --rm playwright bunx playwright test \
|
|
||||||
--fail-on-flaky-tests \
|
|
||||||
--trace=retain-on-failure
|
|
||||||
docker compose down -v --remove-orphans || true
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
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)
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
name: Test Docker Compose
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- bt
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-docker-compose:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout and verify compose stack
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
git clone "http://172.17.0.1:3000/${{ github.repository }}.git" .
|
|
||||||
git checkout "${{ github.sha }}"
|
|
||||||
|
|
||||||
docker compose build
|
|
||||||
docker compose down -v --remove-orphans || true
|
|
||||||
docker compose up -d --wait backend frontend adminer
|
|
||||||
|
|
||||||
curl -fsS http://localhost:8000/api/v1/utils/health-check
|
|
||||||
curl -fsS http://localhost:5173
|
|
||||||
|
|
||||||
docker compose down -v --remove-orphans || true
|
|
||||||
Reference in New Issue
Block a user