Files
archicratie-edition/.gitea/workflows/ci.yml
Archicratia 0f94676b27
Some checks failed
CI / build-and-anchors (push) Failing after 2m29s
CI / build-and-anchors (pull_request) Failing after 10s
ci: remove apt dependency + force LAN DNS in job container
2026-01-21 13:56:13 +01:00

64 lines
2.0 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["master"]
jobs:
build-and-anchors:
runs-on: ubuntu-latest
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 -euo pipefail
echo "== resolv.conf (before) =="; cat /etc/resolv.conf || true
# IMPORTANT: on enlève 1.1.1.1/9.9.9.9 qui time-out chez toi
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: ${{ github.server_url }}
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
TOKEN: ${{ secrets.CI_TOKEN }}
run: |
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/$REPO.git" .
else
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"
- name: Install deps
run: npm ci
- name: Inline scripts syntax check
run: node scripts/check-inline-js.mjs
- name: Build
run: npm run build
- name: Anchors contract
run: npm run test:anchors