ci(forgejo): install the .nvmrc Node before npm on the Linux runner
Some checks failed
ci / 정본·보안·린트·타입·테스트 (push) Failing after 59s
ci / 워크스페이스 빌드 검증 (push) Has been skipped
ci / 모바일 린트·타입·Jest (push) Successful in 41s
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 21s
ci / .NET API 서버 테스트 (push) Successful in 16s
deploy-site / deploy (push) Successful in 21s

The first real Forgejo CI run failed because the linux-builder runner ships
Node 18.19: scripts using import.meta.dirname threw, and its older npm
reported the mobile lock as out of sync with the file: dependency on
packages/core (the lock is in sync under Node 24's npm).

bootstrap-linux-toolchain.sh gains a checksum-verified `node` mode
(24.19.0, the .nvmrc version); ci.yml (quality, build-validation,
mobile-quality) and deploy-site.yml add it to GITHUB_PATH before npm runs.
This commit is contained in:
Yun Chan 2026-09-26 21:05:34 +09:00
parent eedd127ea7
commit b8a09c0333
3 changed files with 49 additions and 3 deletions

View file

@ -44,9 +44,14 @@ jobs:
git checkout -q -f FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfdx git clean -qfdx
- name: 도구 버전 - name: Node (.nvmrc) 설치
shell: bash
run: | run: |
echo "node $(node --version) (.nvmrc $(cat .nvmrc)) / npm $(npm --version)" set -euo pipefail
export CI_PROJECT_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/d3ro-ci"
. scripts/ci/bootstrap-linux-toolchain.sh node
dirname "$(command -v node)" >> "$GITHUB_PATH"
echo "node $(node --version) / npm $(npm --version)"
- name: 의존성 설치 - name: 의존성 설치
run: npm ci run: npm ci
@ -95,6 +100,15 @@ jobs:
git checkout -q -f FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfdx git clean -qfdx
- name: Node (.nvmrc) 설치
shell: bash
run: |
set -euo pipefail
export CI_PROJECT_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/d3ro-ci"
. scripts/ci/bootstrap-linux-toolchain.sh node
dirname "$(command -v node)" >> "$GITHUB_PATH"
echo "node $(node --version) / npm $(npm --version)"
- name: 의존성 설치 - name: 의존성 설치
run: npm ci run: npm ci
@ -122,6 +136,15 @@ jobs:
git checkout -q -f FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfdx git clean -qfdx
- name: Node (.nvmrc) 설치
shell: bash
run: |
set -euo pipefail
export CI_PROJECT_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/d3ro-ci"
. scripts/ci/bootstrap-linux-toolchain.sh node
dirname "$(command -v node)" >> "$GITHUB_PATH"
echo "node $(node --version) / npm $(npm --version)"
- name: 의존성 설치 - name: 의존성 설치
run: | run: |
npm ci npm ci

View file

@ -30,6 +30,14 @@ jobs:
git checkout -q -f FETCH_HEAD git checkout -q -f FETCH_HEAD
git clean -qfdx git clean -qfdx
- name: Node (.nvmrc) 설치
shell: bash
run: |
set -euo pipefail
export CI_PROJECT_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/d3ro-ci"
. scripts/ci/bootstrap-linux-toolchain.sh node
dirname "$(command -v node)" >> "$GITHUB_PATH"
- name: 모바일 릴리스 공개 경계 검사 - name: 모바일 릴리스 공개 경계 검사
run: node scripts/ci/verify-mobile-release-boundary.mjs --self-test run: node scripts/ci/verify-mobile-release-boundary.mjs --self-test

View file

@ -8,7 +8,7 @@ set -euo pipefail
mode="${1:-}" mode="${1:-}"
if [[ -z "$mode" ]]; then if [[ -z "$mode" ]]; then
echo 'bootstrap-linux-toolchain: mode is required (dotnet|deno|android)' >&2 echo 'bootstrap-linux-toolchain: mode is required (node|dotnet|deno|android)' >&2
return 64 2>/dev/null || exit 64 return 64 2>/dev/null || exit 64
fi fi
@ -32,6 +32,20 @@ download_verified() {
esac esac
} }
# 러너 기본 node(Forgejo linux-builder는 18.x)는 .nvmrc(24.19.0)보다 낮다.
bootstrap_node() {
local node_root="$tools_root/node-v24.19.0-linux-x64"
if [[ ! -x "$node_root/bin/node" ]]; then
local archive
archive="$(mktemp "${TMPDIR:-/tmp}/d3ro-node.XXXXXX.tar.gz")"
download_verified 'https://nodejs.org/dist/v24.19.0/node-v24.19.0-linux-x64.tar.gz' 'f625d97cd707df4ff96254916fbc5ff014f09c09effe5a1e0ca8f6d41a8789d4' "$archive"
tar --extract --gzip --file "$archive" --directory "$tools_root"
rm -f "$archive"
fi
export PATH="$node_root/bin:$PATH"
[[ "$(node --version)" == "v$(cat .nvmrc)" ]]
}
bootstrap_dotnet() { bootstrap_dotnet() {
export DOTNET_ROOT="$tools_root/dotnet-sdk-10.0.302" export DOTNET_ROOT="$tools_root/dotnet-sdk-10.0.302"
if [[ ! -x "$DOTNET_ROOT/dotnet" ]]; then if [[ ! -x "$DOTNET_ROOT/dotnet" ]]; then
@ -125,6 +139,7 @@ bootstrap_android() {
} }
case "$mode" in case "$mode" in
node) bootstrap_node ;;
dotnet) bootstrap_dotnet ;; dotnet) bootstrap_dotnet ;;
deno) bootstrap_deno ;; deno) bootstrap_deno ;;
android) bootstrap_android ;; android) bootstrap_android ;;