Compare commits

...

6 Commits

Author SHA1 Message Date
pavlov346346-source
c985714ad6 ci(gitea): run e2e tests with a single worker, VPS can't handle parallel chromium+webkit
Some checks are pending
Caterium QA / qa (push) Waiting to run
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 16:42:41 +03:00
pavlov346346-source
3c15562e08 ci(gitea): install php-curl, proxy-http tests need CURLOPT_* constants
Some checks are pending
Caterium QA / qa (push) Waiting to run
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 14:29:27 +03:00
pavlov346346-source
66ab47de72 ci(gitea): install php-cli, act_runner image doesn't ship with php
Some checks failed
Caterium QA / qa (push) Failing after 1m33s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 14:27:17 +03:00
pavlov346346-source
893f2f6a67 ci(gitea): don't fail pipeline on npm audit, npmmirror.com lacks the advisories endpoint
Some checks failed
Caterium QA / qa (push) Failing after 1m20s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 14:24:50 +03:00
pavlov346346-source
e5e4e4208d ci(gitea): route npm through npmmirror.com, registry.npmjs.org unreachable from this host
Some checks failed
Caterium QA / qa (push) Failing after 1m12s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 14:13:54 +03:00
pavlov346346-source
8f5fff421a ci: add Gitea Actions workflow mirroring GitHub qa.yml
Some checks failed
Caterium QA / qa (push) Failing after 8m6s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 13:33:13 +03:00

78
.gitea/workflows/qa.yml Normal file
View File

@ -0,0 +1,78 @@
name: Caterium QA
on:
push:
pull_request:
concurrency:
group: caterium-qa-${{ github.ref }}
cancel-in-progress: true
jobs:
qa:
runs-on: ubuntu-latest
env:
# registry.npmjs.org sits behind Cloudflare IPs that this self-hosted
# runner cannot reach (times out on both IPv4 and IPv6). npmmirror.com
# mirrors the full npm registry and is reachable, so point npm at it
# instead of failing every install. GitHub-hosted runners don't need
# this, which is why .github/workflows/qa.yml doesn't set it.
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- name: Audit dependencies (retry service errors only)
# npmmirror.com (see NPM_CONFIG_REGISTRY above) doesn't implement
# npm's bulk security-advisories endpoint, so this always reports
# "audit endpoint returned an error" here even though installs
# work fine. The real audit still runs on GitHub-hosted runners
# against registry.npmjs.org (.github/workflows/qa.yml), so don't
# fail the whole Gitea pipeline over a check this runner can't
# physically perform.
continue-on-error: true
timeout-minutes: 4
shell: bash
run: |
set -euo pipefail
report="$(mktemp)"
trap 'rm -f "$report"' EXIT
for attempt in 1 2 3; do
set +e
npm audit --audit-level=high --loglevel=verbose > "$report" 2>&1
status=$?
set -e
cat "$report"
if [ "$status" -eq 0 ]; then exit 0; fi
# An actual vulnerability report fails immediately. A failed
# registry response is retried, never accepted as a clean audit.
if ! grep -Eq 'audit endpoint returned an error|ENOTFOUND|ECONNRESET|EAI_AGAIN|ETIMEDOUT|E429|E503' "$report"; then
exit "$status"
fi
if [ "$attempt" -eq 3 ]; then exit "$status"; fi
echo "Audit service unavailable; retry $attempt/3 after a delay."
sleep "$((attempt * 20))"
done
exit 1
- run: npm run check:deploy
- name: Install PHP CLI
# The self-hosted act_runner image (unlike GitHub's ubuntu-latest)
# ships without PHP at all, so the lint/proxy steps below fail with
# "php: command not found" unless we install it first. php-curl is
# needed too: tests/proxy-http.php calls CURLOPT_* constants, which
# the bare php-cli package doesn't define.
run: |
apt-get update -y
apt-get install -y --no-install-recommends php-cli php-curl
- run: php -l public/api/index.php && php -l ops/timeweb/api-proxy.php
- run: php tests/proxy-http.php app && php tests/proxy-http.php api
- run: npx playwright install --with-deps chromium webkit
- name: Run e2e tests
# This VPS (2 CPU / 4GB) also runs Gitea + Postgres + Caddy. Playwright's
# default worker count (one per CPU, all projects in parallel) spins up
# chromium and webkit processes concurrently and has twice now driven the
# host into an unresponsive state (server needed a hard reboot) partway
# through this step. --workers=1 runs the same test suite serially
# instead of in parallel — slower, but it keeps peak memory/CPU to one
# browser process at a time. GitHub-hosted runners have real headroom,
# so .github/workflows/qa.yml keeps full parallelism.
run: npx playwright test --config=tests/playwright.config.mjs --workers=1