Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 45 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ on:
push:
pull_request:
workflow_dispatch:
inputs:
quickjs_build_ref:
description: "quickjs-build tag, branch or commit (default: its latest release)"
type: string
required: false
default: ""
# Called by release.yml, which passes the quickjs-build release it packages.
workflow_call:
inputs:
quickjs_build_ref:
type: string
required: false
default: ""

permissions:
contents: read
Expand All @@ -13,10 +26,6 @@ concurrency:
cancel-in-progress: true

env:
# quickjs-build is built from source as a sibling directory (the default of
# QJSNAPI_QUICKJS_DIR and of the toolchain path in CMakePresets.json).
# The branch with QuickJS 2026-06-04; switch to a tag once it is released.
QUICKJS_BUILD_REF: feat/quickjs-2026-06-04
# Same major version as the local parity runs (Node.js 22.23).
NODE_VERSION: "22"
# UBSan findings fail the test (-fno-sanitize-recover is set by CMake too).
Expand All @@ -26,6 +35,34 @@ env:
TSAN_OPTIONS: halt_on_error=1:second_deadlock_stack=1

jobs:
# ----------------------------------------------------------------------------
# quickjs-build is built from source as a sibling directory (the default of
# QJSNAPI_QUICKJS_DIR and of the toolchain path in CMakePresets.json): its
# latest release, or the ref given as input. CMake checks that its QuickJS
# headers are the ones in include/.
# ----------------------------------------------------------------------------
quickjs-build:
name: quickjs-build ref
runs-on: ubuntu-24.04
outputs:
ref: ${{ steps.ref.outputs.ref }}
steps:
- id: ref
env:
GH_TOKEN: ${{ github.token }}
INPUT_REF: ${{ inputs.quickjs_build_ref }}
run: |
ref=$INPUT_REF
if [ -z "$ref" ]; then
ref=$(gh release view --repo napi-bindings/quickjs-build --json tagName --jq .tagName)
fi
if [ -z "$ref" ]; then
echo "::error::cannot determine the latest quickjs-build release"
exit 1
fi
echo "quickjs-build: $ref"
echo "ref=$ref" >> "$GITHUB_OUTPUT"

# ----------------------------------------------------------------------------
# Linux and macOS: native builds with the system compiler. The Debug builds
# keep QuickJS's assertion that JS_FreeRuntime finds no live object, so every
Expand All @@ -36,6 +73,7 @@ jobs:
# ----------------------------------------------------------------------------
unix:
name: ${{ matrix.name }}
needs: quickjs-build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -75,7 +113,7 @@ jobs:
- uses: actions/checkout@v7
with:
repository: napi-bindings/quickjs-build
ref: ${{ env.QUICKJS_BUILD_REF }}
ref: ${{ needs.quickjs-build.outputs.ref }}
path: quickjs-build
- uses: actions/setup-python@v7
with:
Expand Down Expand Up @@ -115,6 +153,7 @@ jobs:
# ----------------------------------------------------------------------------
windows:
name: ${{ matrix.name }}
needs: quickjs-build
runs-on: windows-latest
strategy:
fail-fast: false
Expand All @@ -135,7 +174,7 @@ jobs:
- uses: actions/checkout@v7
with:
repository: napi-bindings/quickjs-build
ref: ${{ env.QUICKJS_BUILD_REF }}
ref: ${{ needs.quickjs-build.outputs.ref }}
path: quickjs-build
- uses: actions/setup-python@v7
with:
Expand Down
Loading
Loading