From 5140784dc783da2c11cb8d6ff7214fd466593de7 Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 28 Jul 2026 21:33:55 +0200 Subject: [PATCH] ci: update workflow to use checkout action --- .gitea/workflows/ci.yaml | 64 +++++++++++++++------------------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 7af36ec6..9df3720b 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -6,52 +6,34 @@ on: jobs: check: - runs-on: shell + runs-on: ubuntu-latest # Of 'shell' als je expliciet een lokale host-runner gebruikt steps: + # Stap 1: Laat Gitea Actions automatisch de juiste PR-code ophalen + # Dit vervangt de hele handmatige 'git clone / git fetch' bash-code + - name: Checkout code + uses: actions/checkout@v4 + + # Stap 2: Installeer Node.js en pnpm + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 # Pas aan naar jouw Node-versie indien nodig + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 # Pas aan naar jouw pnpm-versie indien nodig + + # Stap 3: Voer je checks uit - name: Typecheck, lint, and test + env: + SKIP_ENV_VALIDATION: 1 + ARGON2_MEMORY_SIZE: 1024 + ARGON2_ITERATIONS: 1 + BCRYPT_ROUNDS: 4 run: | - set -e - exec 2>&1 - - BARE="/docker/gitea/gitea/git/repositories/remco/epicnext-cms.git" - REF="${{ gitea.sha }}" - HEAD_REF="${{ gitea.head_ref }}" - if [ -z "${REF}" ]; then - echo "ERROR: missing gitea.sha" >&2 - exit 1 - fi - - WORK="$(mktemp -d /var/tmp/epicnext-ci.XXXXXX)" - cleanup() { rm -rf "${WORK}"; } - trap cleanup EXIT - - echo "--- CI checks ---" - echo "REF=${REF}" - echo "HEAD_REF=${HEAD_REF}" - echo "WORK=${WORK}" - - git clone --no-checkout "${BARE}" "${WORK}" - cd "${WORK}" - - # Prefer the PR branch tip (reliable on Gitea); fall back to exact SHA. - if [ -n "${HEAD_REF}" ] && git fetch --depth 1 origin "${HEAD_REF}"; then - git checkout -f FETCH_HEAD - else - echo "Branch fetch failed; trying SHA ${REF}" - git fetch --depth 1 origin "${REF}" - git checkout -f FETCH_HEAD - fi - - echo "Checked out $(git rev-parse --short HEAD)" - git log -1 --oneline - - export SKIP_ENV_VALIDATION=1 - export ARGON2_MEMORY_SIZE=1024 - export ARGON2_ITERATIONS=1 - export BCRYPT_ROUNDS=4 pnpm install --frozen-lockfile pnpm prisma:generate pnpm biome:lint pnpm typecheck pnpm test - echo "--- CI checks passed ---"