Skip to content

fix(export): validate StepExporter output against ifcopenshell.validate #1674

fix(export): validate StepExporter output against ifcopenshell.validate

fix(export): validate StepExporter output against ifcopenshell.validate #1674

Workflow file for this run

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# SDK canary — runs the bundled `tests/extensions/canaries/` set against the
# current `@ifc-lite/extensions` library on every PR. The goal is to catch
# SDK-shape regressions early: if a canary bundle's manifest.tests no longer
# pass against the candidate SDK, the PR is flagged before merge.
#
# This is the Phase 4 / RFC §06 §5 canary loop. The hosted registry version
# (T18 full) substitutes the canary set with extensions pulled from the
# registry; for v1 we use a curated fixture set checked into the repo.
name: SDK canary
# `paths:` below names every package `pnpm turbo build --filter=@ifc-lite/extensions
# --filter=@ifc-lite/cli` transitively builds (turbo's `build` task depends on
# `^build`, so it walks the full `dependencies` + `devDependencies` workspace
# graph of both, in topological order) plus the canary fixtures and this file
# itself. `scripts/check-sdk-canary-coverage.mjs` derives that closure from the
# real package.json graph on every CI run and fails if this list falls behind
# it -- so this is a snapshot of a derived fact, not a maintained one; if the
# list and the gate disagree, trust the gate and regenerate the list from its
# output. Note `@ifc-lite/viewer-core` lives in `packages/viewer`, not
# `packages/viewer-core` -- the package NAME and its directory diverge.
on:
pull_request:
branches: [main]
paths:
- 'packages/bcf/**'
- 'packages/clash/**'
- 'packages/cli/**'
- 'packages/codegen/**'
- 'packages/collab/**'
- 'packages/create/**'
- 'packages/data/**'
- 'packages/diff/**'
- 'packages/drawing-2d/**'
- 'packages/encoding/**'
- 'packages/export/**'
- 'packages/extensions/**'
- 'packages/geometry/**'
- 'packages/ids/**'
- 'packages/ifcx/**'
- 'packages/lens/**'
- 'packages/lists/**'
- 'packages/mcp/**'
- 'packages/merge/**'
- 'packages/mutations/**'
- 'packages/parser/**'
- 'packages/pointcloud/**'
- 'packages/query/**'
- 'packages/sandbox/**'
- 'packages/sdk/**'
- 'packages/spatial/**'
- 'packages/timing-ladder/**'
- 'packages/viewer/**'
- 'packages/wasm/**'
- 'packages/world-frame-fixtures/**'
- 'tests/extensions/canaries/**'
- '.github/workflows/sdk-canary.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
canary:
name: Run canary bundles
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
lfs: false
- name: Setup pnpm
# v6 reads the pnpm version from the `packageManager` field in
# package.json (`pnpm@10.8.1`); passing `with.version` would conflict.
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: pnpm
# @ifc-lite/cli transitively type-depends on @ifc-lite/wasm (its deps'
# .d.ts files reference it), and @ifc-lite/wasm's build is wasm-pack —
# so this job needs the full wasm toolchain too.
- name: Setup WASM build toolchain
uses: ./.github/actions/setup-wasm-build
with:
cache-prefix: sdk-canary
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build WASM
run: bash scripts/build-wasm.sh
# `turbo build` honours `^build`, so this builds every workspace
# dependency of cli/extensions in topological order. The previous
# `pnpm -F @ifc-lite/cli build` built cli alone and failed because
# @ifc-lite/create, query, data, parser, export, sdk and viewer-core
# had no dist/ to resolve against.
- name: Build extensions + CLI
run: pnpm turbo build --filter=@ifc-lite/extensions --filter=@ifc-lite/cli
# Canaries are a curated fixture set. Each subdirectory under
# tests/extensions/canaries/ is a bundle. We run the CLI's
# `ext test` against every one; non-zero exit fails the job.
- name: Run canary bundles
run: |
set -e
if [ ! -d tests/extensions/canaries ]; then
echo "No canary bundles in tests/extensions/canaries/; skipping."
exit 0
fi
failures=0
for dir in tests/extensions/canaries/*/; do
name=$(basename "$dir")
echo "::group::canary: $name"
if ! node packages/cli/dist/index.js ext test "$dir" --json; then
echo "::error::canary $name failed"
failures=$((failures+1))
fi
echo "::endgroup::"
done
if [ "$failures" -gt 0 ]; then
echo "$failures canary bundle(s) failed."
exit 1
fi
echo "All canary bundles passed."