From 8f5fff421a4d9be35118cdb96dd7f5ab35711de7 Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Wed, 23 Sep 2026 13:33:13 +0300 Subject: [PATCH] ci: add Gitea Actions workflow mirroring GitHub qa.yml Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/qa.yml | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/qa.yml diff --git a/.gitea/workflows/qa.yml b/.gitea/workflows/qa.yml new file mode 100644 index 0000000..659be70 --- /dev/null +++ b/.gitea/workflows/qa.yml @@ -0,0 +1,45 @@ +name: Caterium QA +on: + push: + pull_request: +concurrency: + group: caterium-qa-${{ github.ref }} + cancel-in-progress: true +jobs: + qa: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm ci + - name: Audit dependencies (retry service errors only) + 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 + - 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 + - run: npm run test:e2e