From 599ece37b2521ffe66f7cf2fede93ce47af0898c Mon Sep 17 00:00:00 2001 From: Archicratia Date: Wed, 21 Jan 2026 19:31:42 +0100 Subject: [PATCH] Revert "Merge pull request 'ci: fix shell (dash) by removing pipefail' (#47) from fix/ci-sh-no-pipefail into master" This reverts commit cec0a75fc829f3f2034e34664daf6d601ef684f3, reversing changes made to d1caff6b2153645b99484a7eac4bf6eccf17ccfc. --- .gitea/workflows/ci.yml | 60 ++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c0fbc70..0be9cc8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,57 +2,61 @@ name: CI on: push: + branches: ["**"] pull_request: + branches: ["master"] jobs: build-and-anchors: runs-on: ubuntu-latest - - # On garde ton image devcontainers (elle a généralement git, etc.) container: + # Image avec node + git déjà présents -> pas d'APT image: mcr.microsoft.com/devcontainers/javascript-node:20-bookworm + # On force root pour pouvoir écrire /etc/resolv.conf (sinon user "node") + options: >- + --user root + --add-host gitea.archicratie.trans-hands.synology.me:192.168.1.20 steps: + - name: Force DNS inside job container (DS220+ / act_runner) + run: | + set -eu + echo "== resolv.conf (before) =="; cat /etc/resolv.conf || true + + cat > /etc/resolv.conf <<'EOF' + nameserver 192.168.1.1 + nameserver 109.0.66.10 + options timeout:2 attempts:2 + EOF + + echo "== resolv.conf (after) =="; cat /etc/resolv.conf + node -e 'require("dns").resolve4("deb.debian.org",(e,a)=>console.log("dns",e||a))' + - name: Checkout (from Gitea, no external actions) env: - SERVER_URL: ${{ github.server_url }} - REPOSITORY: ${{ github.repository }} + SERVER: ${{ github.server_url }} + REPO: ${{ github.repository }} SHA: ${{ github.sha }} TOKEN: ${{ secrets.CI_TOKEN }} run: | - set -eu - echo "Server: $SERVER_URL" - echo "Repo: $REPOSITORY" - echo "SHA: $SHA" - - rm -rf .git || true - + set -euo pipefail if [ -n "${TOKEN:-}" ]; then - AUTH="$(printf 'oauth2:%s' "$TOKEN" | base64 | tr -d '\n')" - git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER_URL/$REPOSITORY.git" . + AUTH="$(printf "oauth2:%s" "$TOKEN" | base64 | tr -d '\n')" + git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER/$REPO.git" . else - git clone "$SERVER_URL/$REPOSITORY.git" . + echo "ℹ️ CI_TOKEN absent → clone sans auth (repo public ou accès runner déjà OK)." + git clone "$SERVER/$REPO.git" . fi - git checkout "$SHA" - git status --porcelain=v1 - name: Install deps - run: | - set -eu - npm ci + run: npm ci - name: Inline scripts syntax check - run: | - set -eu - node scripts/check-inline-js.mjs + run: node scripts/check-inline-js.mjs - name: Build - run: | - set -eu - npm run build + run: npm run build - name: Anchors contract - run: | - set -eu - node scripts/check-anchors.mjs + run: npm run test:anchors