ci: fix shell (dash) by removing pipefail
This commit is contained in:
@@ -2,61 +2,57 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["**"]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["master"]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-anchors:
|
build-and-anchors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# On garde ton image devcontainers (elle a généralement git, etc.)
|
||||||
container:
|
container:
|
||||||
# Image avec node + git déjà présents -> pas d'APT
|
|
||||||
image: mcr.microsoft.com/devcontainers/javascript-node:20-bookworm
|
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:
|
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)
|
- name: Checkout (from Gitea, no external actions)
|
||||||
env:
|
env:
|
||||||
SERVER: ${{ github.server_url }}
|
SERVER_URL: ${{ github.server_url }}
|
||||||
REPO: ${{ github.repository }}
|
REPOSITORY: ${{ github.repository }}
|
||||||
SHA: ${{ github.sha }}
|
SHA: ${{ github.sha }}
|
||||||
TOKEN: ${{ secrets.CI_TOKEN }}
|
TOKEN: ${{ secrets.CI_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -eu
|
||||||
|
echo "Server: $SERVER_URL"
|
||||||
|
echo "Repo: $REPOSITORY"
|
||||||
|
echo "SHA: $SHA"
|
||||||
|
|
||||||
|
rm -rf .git || true
|
||||||
|
|
||||||
if [ -n "${TOKEN:-}" ]; then
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
AUTH="$(printf "oauth2:%s" "$TOKEN" | base64 | tr -d '\n')"
|
AUTH="$(printf 'oauth2:%s' "$TOKEN" | base64 | tr -d '\n')"
|
||||||
git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER/$REPO.git" .
|
git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER_URL/$REPOSITORY.git" .
|
||||||
else
|
else
|
||||||
echo "ℹ️ CI_TOKEN absent → clone sans auth (repo public ou accès runner déjà OK)."
|
git clone "$SERVER_URL/$REPOSITORY.git" .
|
||||||
git clone "$SERVER/$REPO.git" .
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git checkout "$SHA"
|
git checkout "$SHA"
|
||||||
|
git status --porcelain=v1
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm ci
|
run: |
|
||||||
|
set -eu
|
||||||
|
npm ci
|
||||||
|
|
||||||
- name: Inline scripts syntax check
|
- name: Inline scripts syntax check
|
||||||
run: node scripts/check-inline-js.mjs
|
run: |
|
||||||
|
set -eu
|
||||||
|
node scripts/check-inline-js.mjs
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: |
|
||||||
|
set -eu
|
||||||
|
npm run build
|
||||||
|
|
||||||
- name: Anchors contract
|
- name: Anchors contract
|
||||||
run: npm run test:anchors
|
run: |
|
||||||
|
set -eu
|
||||||
|
node scripts/check-anchors.mjs
|
||||||
|
|||||||
Reference in New Issue
Block a user