mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-13 08:09:04 +02:00
Bumps the github-actions-dependencies group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/upload-artifact` from 7.0.1 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9) Updates `actions/setup-node` from 7.0.0 to 7.1.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-dependencies - dependency-name: actions/setup-node dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
99 lines
2.9 KiB
YAML
99 lines
2.9 KiB
YAML
name: Run Tests
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- dev
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Install Node
|
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
# 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
|
|
run: cp config/config.example.yml config/config.yml
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Create database index.ts
|
|
run: npm run set:sqlite
|
|
|
|
- name: Create build file
|
|
run: npm run set:oss
|
|
|
|
- name: Generate database migrations
|
|
run: npm run db:generate
|
|
|
|
- name: Apply database migrations
|
|
run: npm run db:push
|
|
|
|
- name: Test with tsc
|
|
run: npx tsc --noEmit
|
|
|
|
- name: Start app in background
|
|
run: |
|
|
nohup npm run dev > app.log 2>&1 &
|
|
echo $! > app.pid
|
|
|
|
- name: Wait for app availability
|
|
run: |
|
|
print_log() {
|
|
if [ -f app.log ]; then cat app.log; else echo "(app.log not found)"; fi
|
|
}
|
|
for i in {1..5}; do
|
|
if curl --silent --fail http://localhost:3002/auth/login; then
|
|
echo "App is up"
|
|
exit 0
|
|
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"
|
|
sleep 5
|
|
done
|
|
echo "App failed to start. Output:"
|
|
print_log
|
|
exit 1
|
|
|
|
build-sqlite:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Build Docker image sqlite
|
|
run: make dev-build-sqlite
|
|
|
|
build-postgres:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Build Docker image pg
|
|
run: make dev-build-pg
|