Skip to content

chore: release v149.4.0-rc.3 #346

chore: release v149.4.0-rc.3

chore: release v149.4.0-rc.3 #346

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Newer push cancels the older in-flight run — but ONLY for PRs. Main runs are
# never cancelled: the report job aggregates per-job artifacts and publishes the
# dashboard, so cancelling a main run mid-flight would let its report job (which
# runs even on partial results) publish a dashboard missing the cells whose jobs
# hadn't uploaded yet — exactly the flapping (version vanishing, "38" vs
# "38/264") seen when several main pushes land close together.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# ---------------------------------------------------------------------------
# Fast checks: `cargo build --lib` per backend. Catches compile breakage
# without building a full deno. quickjs is cross-platform (ubuntu); the JSC
# backends need macOS (system_jsc links the OS framework, jsc builds the
# vendored WebKit from source — cached, see below).
# ---------------------------------------------------------------------------
check:
name: check-${{ matrix.backend }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- backend: quickjs
os: ubuntu-latest
features: quickjs
- backend: sys-jsc
os: macos-latest
features: system_jsc
- backend: jsc
os: macos-15
features: engine_jsc,vendor_jsc
ninja: true
env:
MACOSX_DEPLOYMENT_TARGET: "15.0"
steps:
- uses: actions/checkout@v4
with:
submodules: false
# vendor/webkit is 8.9 GB and only the jsc backend builds it. Init just
# the submodules this backend needs (everything except webkit) unless
# this is the jsc leg (matrix.ninja). Saves ~3min of checkout off the
# non-jsc critical path.
- name: Init submodules
run: |
if [ "${{ matrix.ninja }}" = "true" ]; then
git submodule update --init --depth 1 --recursive
else
git submodule update --init --depth 1 vendor/rusty_v8 vendor/quickjs-ng vendor/wamr
fi
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: check-${{ matrix.backend }}
- name: Install ninja (WebKit build)
if: matrix.ninja
run: brew install ninja
# Cache the vendored WebKit static-lib build (~13min from scratch). Keyed
# on the pinned submodule commit + WebKit patches/setup script, so it's
# reused until WebKit inputs change. build.rs skips the heavy
# build when libJavaScriptCore.a is already present (patches-only).
- name: WebKit cache key
if: matrix.ninja
id: wk
run: echo "sha=$(git rev-parse HEAD:vendor/webkit)" >> "$GITHUB_OUTPUT"
- name: Cache vendored WebKit build
if: matrix.ninja
uses: actions/cache@v4
with:
path: vendor/webkit/WebKitBuild
key: webkit-${{ runner.os }}-${{ steps.wk.outputs.sha }}-${{ hashFiles('patches/webkit-*.patch', 'tools/setup_webkit.sh') }}
- name: Build --lib (${{ matrix.features }})
run: cargo build --no-default-features --features ${{ matrix.features }} --lib
# --- hill-climb: rusty_v8 suite (build tier) ---------------------------
# Cheapest suite — vendored rusty_v8 integration tests run unmodified
# against our shim ([[test]] rv8_* in Cargo.toml). PRs ratchet strictly
# (--check: red on regression or un-baselined new pass); main just records
# a run-result artifact the `report` job folds in.
- uses: actions/setup-node@v4
with:
node-version: 22
- name: rusty_v8 suite (${{ matrix.backend }})
run: |
# --rescue solo-reruns batch-FAILED tests (poisoned PROCESS_LOCK
# fallout — see run.mjs rescueHiddenPasses). Opt-in per cell: a cell
# turning it on must refresh its baseline in the same PR.
RESCUE=""
if [ "${{ matrix.backend }}" = "quickjs" ]; then RESCUE="--rescue"; fi
if [ "${{ github.event_name }}" = "pull_request" ]; then
node tests/harness/run.mjs rusty_v8 ${{ matrix.backend }} --check $RESCUE
else
node tests/harness/run.mjs rusty_v8 ${{ matrix.backend }} $RESCUE
fi
- name: Upload run results
if: always()
uses: actions/upload-artifact@v4
with:
name: runs-${{ matrix.backend }}-rusty_v8
path: tests/status/.runs/
include-hidden-files: true
if-no-files-found: ignore
# ---------------------------------------------------------------------------
# Windows buildability for the quickjs backend (issue #65). Build-only: no
# test cell/baseline yet — this just keeps `cargo build` green on MSVC
# (pure-Rust vendor setup in build.rs, per-target gen bindings, MSVC C11
# atomics for quickjs, multi-config cmake for WAMR).
# ---------------------------------------------------------------------------
windows-build:
name: check-quickjs-windows-${{ matrix.arch }}-${{ matrix.crt }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
crt: dynamic
runner: windows-2022
rustflags: ""
- arch: x86_64
crt: static
runner: windows-2022
rustflags: "-C target-feature=+crt-static"
- arch: aarch64
crt: static
runner: windows-11-arm
rustflags: "-C target-feature=+crt-static"
env:
RUSTFLAGS: ${{ matrix.rustflags }}
steps:
# Git for Windows defaults to core.autocrlf=true, which corrupts the
# git-binary-delta patches at checkout and CRLFs the submodule trees the
# text patches context-match against. .gitattributes pins *.patch, but
# the submodule checkouts below have no such attributes — force LF.
- name: Force LF checkouts
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
with:
submodules: false
- name: Init submodules
run: git submodule update --init --depth 1 vendor/rusty_v8 vendor/quickjs-ng vendor/wamr
- name: Simulate stale Cargo git checkout
if: matrix.arch == 'x86_64' && matrix.crt == 'dynamic'
shell: pwsh
run: |
New-Item -ItemType File .cargo-ok
New-Item -ItemType Directory -Force vendor/rusty_v8
Set-Content vendor/rusty_v8/stale-cache-entry "stale worktree"
New-Item -ItemType Directory -Force .git/modules/vendor/rusty_v8
Set-Content .git/modules/vendor/rusty_v8/stale-cache-entry "stale metadata"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: check-quickjs-windows-${{ matrix.arch }}-${{ matrix.crt }}
# Link a test executable, not just an rlib, so CRT mismatches in WAMR's
# static archive are caught here rather than in downstream binaries.
- name: Link --lib test executable (quickjs)
shell: pwsh
run: |
$lockJob = $null
if ("${{ matrix.arch }}" -eq "x86_64" -and "${{ matrix.crt }}" -eq "dynamic") {
$stalePath = (Resolve-Path ".git/modules/vendor/rusty_v8/stale-cache-entry").Path
$worktreePath = (Resolve-Path "vendor/rusty_v8").Path
$lockJob = Start-Job -ScriptBlock {
param($path, $worktree)
$stream = [System.IO.File]::Open(
$path,
[System.IO.FileMode]::Open,
[System.IO.FileAccess]::Read,
[System.IO.FileShare]::None
)
Write-Output "locked"
while ([System.IO.Directory]::Exists($worktree)) {
Start-Sleep -Milliseconds 50
}
Start-Sleep -Seconds 3
$stream.Dispose()
} -ArgumentList $stalePath, $worktreePath
while (@(Receive-Job -Job $lockJob -Keep) -notcontains "locked") {
Start-Sleep -Milliseconds 50
}
}
cargo test --no-default-features --features quickjs --lib --no-run
$cargoExit = $LASTEXITCODE
if ($null -ne $lockJob) {
Wait-Job -Job $lockJob | Out-Null
Remove-Job -Job $lockJob -Force
}
exit $cargoExit
# ---------------------------------------------------------------------------
# deno_core test suite per backend: clone+patch deno, `cargo nextest run -p
# deno_core` against our v8 shim. No full deno binary (node-compat + unit are
# dropped for now to keep CI cheap). macOS so the JSC backends link/JIT.
# ---------------------------------------------------------------------------
deno_core:
name: deno_core-${{ matrix.backend }}
runs-on: macos-15
timeout-minutes: 90
# macOS 15+: WebKit's bmalloc uses os_unfair_lock_lock_with_flags (15.0+),
# fatal under -Werror=unguarded-availability on an older deployment target.
env:
MACOSX_DEPLOYMENT_TARGET: "15.0"
strategy:
fail-fast: false
matrix:
include:
- backend: jsc
features: '"engine_jsc", "vendor_jsc"'
ninja: true
- backend: sys-jsc
features: '"system_jsc"'
- backend: quickjs
features: '"quickjs"'
steps:
- uses: actions/checkout@v4
with:
submodules: false
# See check job: skip the 8.9 GB vendor/webkit checkout except on jsc.
- name: Init submodules
run: |
if [ "${{ matrix.ninja }}" = "true" ]; then
git submodule update --init --depth 1 --recursive
else
git submodule update --init --depth 1 vendor/rusty_v8 vendor/quickjs-ng vendor/wamr
fi
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
# deno_core::tests::test_rebuild_async_stubs shells out to a stock
# `deno` CLI (and panics rather than skipping when it's absent); the
# macos-15 image stopped shipping one.
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install ninja (WebKit build)
if: matrix.ninja
run: brew install ninja
# Reuse the vendored WebKit build across runs (jsc backend only).
- name: WebKit cache key
if: matrix.ninja
id: wk
run: echo "sha=$(git rev-parse HEAD:vendor/webkit)" >> "$GITHUB_OUTPUT"
- name: Cache vendored WebKit build
if: matrix.ninja
uses: actions/cache@v4
with:
path: vendor/webkit/WebKitBuild
key: webkit-${{ runner.os }}-${{ steps.wk.outputs.sha }}-${{ hashFiles('patches/webkit-*.patch', 'tools/setup_webkit.sh') }}
- name: Clone deno + apply the v82jsc integration patch
run: |
set -euo pipefail
DENO_REF="$(cat tools/deno/DENO_REF)"
mkdir -p ../deno && git -C ../deno init -q
git -C ../deno remote add origin https://github.com/denoland/deno
git -C ../deno fetch --depth 1 origin "$DENO_REF"
git -C ../deno checkout -q FETCH_HEAD
# The patch's v8x dependency uses a local development path. Point it
# at this checkout.
sed "s#/Users/divy/gh/v8x#${GITHUB_WORKSPACE}#g" \
tools/deno/deno-jsc-integration.patch > /tmp/deno.patch
(cd ../deno && patch -p1 < /tmp/deno.patch)
# Select this job's backend by swapping the v82jsc feature list the
# patch hardcodes (vendored JSC) for this matrix entry's features.
perl -0pi -e 's/"engine_jsc", "vendor_jsc"/${{ matrix.features }}/g' ../deno/Cargo.toml
# Cache the deno_core build (cargo deps + the v82jsc patch crate). Keyed
# per backend so each engine's feature set gets its own cache.
- uses: Swatinem/rust-cache@v2
with:
workspaces: "../deno"
key: deno_core-${{ matrix.backend }}
- uses: actions/setup-node@v4
with:
node-version: 22
# deno_core test suite only — `cargo nextest run -p deno_core`, no full deno
# binary (node-compat + unit are dropped for now to keep CI cheap).
- name: Run deno_core suite (${{ matrix.backend }})
env:
PR: ${{ github.event_name == 'pull_request' && '--check' || '' }}
run: |
set -uo pipefail
# Same linker flags v82jsc/deno use; otherwise cargo nextest for
# deno_core picks up the deno repo's default -fuse-ld=lld (absent on
# the runner) and fails with "invalid linker name".
export RUSTFLAGS="-C link-arg=-fuse-ld=/usr/bin/ld -C link-arg=-L$(xcrun --show-sdk-path)/usr/lib"
node tests/harness/run.mjs deno_core "${{ matrix.backend }}" $PR --deno-dir=../deno
- name: Upload run results
if: always()
uses: actions/upload-artifact@v4
with:
name: runs-${{ matrix.backend }}-deno_core
path: tests/status/.runs/
include-hidden-files: true
if-no-files-found: ignore
module-tests:
name: module suite (stock-v8 oracle)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Run ES-module conformance suite
run: tests/modules/run.sh "$(command -v deno)" stock-v8
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Pin the toolchain so the rustfmt rules match local. src/lib.rs is NOT
# checked: it `#[path]`-includes the vendored rusty_v8 modules (only
# materialized by build.rs), so rustfmt can't resolve its mod tree.
- uses: dtolnay/rust-toolchain@1.96.0
with:
components: rustfmt
- run: rustfmt --edition 2024 --check src/jsc/*.rs src/quickjs/*.rs
# ---------------------------------------------------------------------------
# Single-writer aggregation. Runs only on push to main (after merge), once,
# gathering every matrix job's run-result artifacts. Folds fresh pass sets
# into the committed baselines (--write-baselines), regenerates the single
# tests/status/report.json and appends a tests/status/history.jsonl snapshot, then commits
# + pushes. Because only this job writes those files, parallel PRs never
# conflict on them. The Pages workflow redeploys the dashboard on that commit.
# ---------------------------------------------------------------------------
report:
name: aggregate report
needs: [check, deno_core]
# !cancelled() (not always()) so a failed/partial matrix leg still seeds
# whatever run-result artifacts were uploaded (the per-suite steps don't fail
# the build on test failures; only infra/build breakage does) — but a
# CANCELLED run does NOT publish, so it can't overwrite the dashboard with a
# half-populated aggregate. (Main runs aren't cancelled anyway; this is belt
# and suspenders.)
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-latest
# Deploys Pages directly (the [skip ci] commit below won't trigger pages.yml).
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Download all run-result artifacts
uses: actions/download-artifact@v4
with:
pattern: runs-*
path: /tmp/runs
merge-multiple: true
- name: Collect run results
run: |
mkdir -p tests/status/.runs
cp -v /tmp/runs/*.json tests/status/.runs/ 2>/dev/null || echo "no run results"
- name: Aggregate (baselines + report + history)
run: node tests/harness/aggregate.mjs --write-baselines --commit="${GITHUB_SHA}"
- name: Commit + push
run: |
git config user.name "divybot"
git config user.email "279198639+divybot@users.noreply.github.com"
git add tests/status/baselines tests/status/report.json tests/status/history.jsonl
if git diff --cached --quiet; then
echo "no changes to report"
else
git commit -m "ci: update test report [skip ci]"
git push origin main
fi
- name: Install typst
run: |
curl -fsSL https://github.com/typst/typst/releases/download/v0.15.0/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ -C /tmp
echo "/tmp/typst-x86_64-unknown-linux-musl" >> "$GITHUB_PATH"
- name: Assemble site (docs + dashboard + data)
run: tools/build-site.sh _site
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deploy
uses: actions/deploy-pages@v4