v8: add a smoke test that exercises v8 on x86

This commit is contained in:
Channing Conger
2026-07-01 10:38:20 -07:00
parent db887d03e1
commit 739cfc5849
2 changed files with 133 additions and 0 deletions

View File

@@ -99,6 +99,7 @@ jobs:
target: aarch64-unknown-linux-gnu
v8_cpu: arm64
variant: ptrcomp-sandbox
# Keep the build on arm64; smoke-macos-x86 tests its staged output on Intel.
- runner: macos-15-xlarge
bazel_config: ci-macos
platform: macos_amd64
@@ -285,6 +286,68 @@ jobs:
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-${{ matrix.variant }}-${{ matrix.target }}
path: dist/${{ matrix.target }}/*
smoke-macos-x86:
name: Smoke test ${{ matrix.variant }} x86_64-apple-darwin on Intel
needs:
- metadata
- build
runs-on: macos-15-large
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- sandbox: false
variant: release
- sandbox: true
variant: ptrcomp-sandbox
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
with:
toolchain: "1.95.0"
- name: Download staged artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-${{ matrix.variant }}-x86_64-apple-darwin
path: dist/x86_64-apple-darwin
- name: Smoke test staged artifact with Cargo
env:
SANDBOX: ${{ matrix.sandbox }}
TARGET: x86_64-apple-darwin
shell: bash
run: |
set -euo pipefail
archive="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'librusty_v8_*.a.gz' -print -quit)"
binding="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'src_binding_*.rs' -print -quit)"
if [[ -z "${archive}" || -z "${binding}" ]]; then
echo "Missing staged archive or binding for ${TARGET}." >&2
exit 1
fi
cargo_args=(test -p codex-v8-poc)
if [[ "${SANDBOX}" == "true" ]]; then
cargo_args+=(--features sandbox)
fi
(
cd codex-rs
CARGO_TARGET_DIR="${RUNNER_TEMP}/rusty-v8-cargo-smoke-${TARGET}-${SANDBOX}" \
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
cargo "${cargo_args[@]}"
)
build-windows-source:
name: Build ptrcomp-sandbox ${{ matrix.target }} from source
needs: metadata
@@ -429,6 +492,7 @@ jobs:
- metadata
- build
- build-windows-source
- smoke-macos-x86
runs-on: ubuntu-latest
permissions:
contents: write

View File

@@ -119,6 +119,7 @@ jobs:
target: aarch64-unknown-linux-gnu
v8_cpu: arm64
variant: ptrcomp-sandbox
# Keep the build on arm64; smoke-macos-x86 tests its staged output on Intel.
- runner: macos-15-xlarge
bazel_config: ci-macos
platform: macos_amd64
@@ -306,6 +307,74 @@ jobs:
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
smoke-macos-x86:
name: Smoke test ${{ matrix.variant }} x86_64-apple-darwin on Intel
needs:
- metadata
- build
if: ${{ needs.metadata.outputs.canary_required == 'true' }}
runs-on: macos-15-large
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- sandbox: false
variant: release
- sandbox: true
variant: ptrcomp-sandbox
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
with:
toolchain: "1.95.0"
- name: Download staged artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: v8-canary-${{ needs.metadata.outputs.v8_version }}-${{ matrix.variant }}-x86_64-apple-darwin
path: dist/x86_64-apple-darwin
- name: Smoke test staged artifact with Cargo
env:
SANDBOX: ${{ matrix.sandbox }}
TARGET: x86_64-apple-darwin
shell: bash
run: |
set -euo pipefail
archive="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'librusty_v8_*.a.gz' -print -quit)"
binding="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'src_binding_*.rs' -print -quit)"
if [[ -z "${archive}" || -z "${binding}" ]]; then
echo "Missing staged archive or binding for ${TARGET}." >&2
exit 1
fi
cargo_args=(test -p codex-v8-poc)
if [[ "${SANDBOX}" == "true" ]]; then
cargo_args+=(--features sandbox)
fi
(
cd codex-rs
CARGO_TARGET_DIR="${RUNNER_TEMP}/rusty-v8-cargo-smoke-${TARGET}-${SANDBOX}" \
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
cargo "${cargo_args[@]}"
)
- name: Check for a clean worktree
if: always() && !cancelled()
uses: ./.github/actions/check-clean-worktree
build-windows-source:
name: Build ptrcomp-sandbox ${{ matrix.target }} from source
needs: metadata