mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-16 07:40:04 +02:00
Merge pull request #3714 from aithal007/fix/ci-pin-node-runtime-version
fix(ci): pin Node to 24.18.1 to match runtime and fix flaky test job
This commit is contained in:
@@ -26,7 +26,10 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
# Match the version the app ships on (Dockerfile /
|
||||||
|
# Dockerfile.dev both use 24.18.1) rather than floating
|
||||||
|
# to the latest 24.x.
|
||||||
|
node-version: '24.18.1'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|||||||
@@ -19,7 +19,13 @@ jobs:
|
|||||||
- name: Install Node
|
- name: Install Node
|
||||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
# Pin to the version the app actually ships on (Dockerfile /
|
||||||
|
# Dockerfile.dev both use 24.18.1; .nvmrc pins the 24 major).
|
||||||
|
# A bare '24' floats to the latest 24.x; Node >= 24.19.0 added
|
||||||
|
# node::ObjectWrap cleanup hooks that crash better-sqlite3 on teardown
|
||||||
|
# ("Assertion failed: (env) != nullptr" in RemoveEnvironmentCleanupHook),
|
||||||
|
# which intermittently kills `npm run dev` in the step below.
|
||||||
|
node-version: '24.18.1'
|
||||||
|
|
||||||
- name: Copy config file
|
- name: Copy config file
|
||||||
run: cp config/config.example.yml config/config.yml
|
run: cp config/config.example.yml config/config.yml
|
||||||
@@ -43,19 +49,34 @@ jobs:
|
|||||||
run: npx tsc --noEmit
|
run: npx tsc --noEmit
|
||||||
|
|
||||||
- name: Start app in background
|
- name: Start app in background
|
||||||
run: nohup npm run dev &
|
run: |
|
||||||
|
nohup npm run dev > app.log 2>&1 &
|
||||||
|
echo $! > app.pid
|
||||||
|
|
||||||
- name: Wait for app availability
|
- name: Wait for app availability
|
||||||
run: |
|
run: |
|
||||||
|
print_log() {
|
||||||
|
if [ -f app.log ]; then cat app.log; else echo "(app.log not found)"; fi
|
||||||
|
}
|
||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
if curl --silent --fail http://localhost:3002/auth/login; then
|
if curl --silent --fail http://localhost:3002/auth/login; then
|
||||||
echo "App is up"
|
echo "App is up"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
# Fail fast (and show why) if the process is gone. Read the PID
|
||||||
|
# safely: if it's missing/empty (e.g. nohup never started), treat
|
||||||
|
# that as "not running" instead of passing a bad arg to kill.
|
||||||
|
pid="$(cat app.pid 2>/dev/null || true)"
|
||||||
|
if [ -z "$pid" ] || ! kill -0 "$pid" 2>/dev/null; then
|
||||||
|
echo "App process exited before becoming available. Output:"
|
||||||
|
print_log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "Waiting for the app... attempt $i"
|
echo "Waiting for the app... attempt $i"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "App failed to start"
|
echo "App failed to start. Output:"
|
||||||
|
print_log
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
build-sqlite:
|
build-sqlite:
|
||||||
|
|||||||
Reference in New Issue
Block a user