chore: import upstream snapshot with attribution
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped

This commit is contained in:
wehub-resource-sync
2026-07-13 12:29:30 +08:00
commit e7738de6d2
1723 changed files with 216139 additions and 0 deletions
+370
View File
@@ -0,0 +1,370 @@
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "17 9 * * *"
workflow_dispatch:
inputs:
validation_depth:
description: Validation depth to run
required: true
default: fast
type: choice
options:
- fast
- deep
permissions:
contents: read
jobs:
conformance-suite:
name: Conformance Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Conformance suite
env:
ZERO_VALIDATION_PHASES: graph-input-policy,native-contracts,provenance-guardrails,type-core-smoke,mir-verifier-smoke,program-graph-smoke,canonical-text-smoke,examples-gate,conformance-run
ZERO_VALIDATION_JOBS: "4"
ZERO_CONFORMANCE_CHECK_JOBS: "4"
run: pnpm run conformance:local
native-preflight:
name: Native Preflight
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Native preflight
env:
ZERO_NATIVE_TEST_PHASES: preflight
ZERO_NATIVE_TEST_SCOPE: fast
run: pnpm run native:test:local
native-runtime-cases:
name: Native Runtime Cases (${{ matrix.shard }}/2)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Native tests
env:
ZERO_NATIVE_TEST_PHASES: cases
ZERO_NATIVE_TEST_SCOPE: fast
ZERO_NATIVE_TEST_SHARD: "${{ matrix.shard }}/2"
run: pnpm run native:test:local
native-metadata-reports:
name: Native Metadata Reports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Native metadata and reports
env:
ZERO_NATIVE_TEST_PHASES: metadata-and-reports
run: pnpm run native:test:local
native-direct-backend-artifacts:
name: Native Direct Backend Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Native direct backend artifacts
env:
ZERO_NATIVE_TEST_PHASES: direct-backend-artifacts
run: pnpm run native:test:local
native-sanitizer-smoke:
name: Native Sanitizer Smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- name: Native sanitizer smoke
run: pnpm run native:sanitize
command-contract-snapshots:
name: Command Contract Snapshots
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- run: pnpm install --frozen-lockfile
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- name: Build native compiler
run: make -C native/zero-c
- name: Command contract snapshots
run: pnpm run command-contracts:local
graph-build-perf:
name: Graph Build Perf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- run: pnpm install --frozen-lockfile
- name: Graph build perf report
env:
ZERO_GRAPH_BUILD_PERF_CASES: hello-artifact,stdlib-heavy-artifact
run: |
mkdir -p .zero
set +e
pnpm run graph:perf:budgets > .zero/graph-build-perf.json
status=$?
cat .zero/graph-build-perf.json
exit $status
deep-conformance-suite:
name: Deep Conformance Suite
if: ${{ github.event_name == 'schedule' || github.event.inputs.validation_depth == 'deep' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Deep conformance suite
env:
ZERO_VALIDATION_JOBS: "4"
ZERO_CONFORMANCE_CHECK_JOBS: "4"
run: pnpm run conformance:local
deep-native-preflight:
name: Deep Native Preflight
if: ${{ github.event_name == 'schedule' || github.event.inputs.validation_depth == 'deep' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Deep native preflight
env:
ZERO_NATIVE_TEST_PHASES: preflight
ZERO_NATIVE_TEST_SCOPE: deep
run: pnpm run native:test:local
deep-native-runtime-cases:
name: Deep Native Runtime Cases (${{ matrix.shard }}/6)
if: ${{ github.event_name == 'schedule' || github.event.inputs.validation_depth == 'deep' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Deep native tests
env:
ZERO_NATIVE_TEST_PHASES: cases
ZERO_NATIVE_TEST_SCOPE: deep
ZERO_NATIVE_TEST_SHARD: "${{ matrix.shard }}/6"
run: pnpm run native:test:local
deep-graph-build-perf:
name: Deep Graph Build Perf
if: ${{ github.event_name == 'schedule' || github.event.inputs.validation_depth == 'deep' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- run: pnpm install --frozen-lockfile
- name: Deep graph build perf report
run: |
mkdir -p .zero
set +e
pnpm run graph:perf:budgets > .zero/deep-graph-build-perf.json
status=$?
cat .zero/deep-graph-build-perf.json
exit $status
workspace-checks:
name: Workspace Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@11.1.3 --activate
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- run: pnpm install --frozen-lockfile
- name: Workspace checks
env:
VERCEL_OIDC_TOKEN: ${{ secrets.VERCEL_OIDC_TOKEN }}
run: pnpm run workspace:checks
+170
View File
@@ -0,0 +1,170 @@
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
check-release:
name: Check for new version
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
outputs:
needs_release: ${{ steps.check.outputs.needs_release }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Check GitHub release status
id: check
run: |
LOCAL_VERSION=$(node -p "require('./package.json').version")
echo "Local version: $LOCAL_VERSION"
TAG="v$LOCAL_VERSION"
EXISTING_ASSETS=$(gh release view "$TAG" --json assets --jq '.assets[].name' 2>/dev/null || true)
missing=0
for asset in \
CHECKSUMS.txt \
zero-darwin-arm64 \
zero-darwin-x64 \
zero-linux-arm64 \
zero-linux-x64 \
zero-linux-musl-arm64 \
zero-linux-musl-x64 \
zero-win32-arm64.exe \
zero-win32-x64.exe
do
if ! printf '%s\n' "$EXISTING_ASSETS" | grep -Fx "$asset" >/dev/null; then
echo "Missing release asset: $asset"
missing=1
fi
done
if [ "$missing" -eq 0 ]; then
echo "GitHub release $TAG exists with all assets"
echo "needs_release=false" >> "$GITHUB_OUTPUT"
else
echo "GitHub release $TAG is missing assets, will create/update"
echo "needs_release=true" >> "$GITHUB_OUTPUT"
fi
echo "version=$LOCAL_VERSION" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-release:
name: Create GitHub Release
needs: check-release
if: needs.check-release.outputs.needs_release == 'true'
runs-on: macos-14
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Install pinned Zig
run: bash scripts/install-zig.sh
- name: Extract changelog entry
run: |
VERSION="${{ needs.check-release.outputs.version }}"
awk '/<!-- release:start -->/{found=1; next} /<!-- release:end -->/{found=0} found{print}' CHANGELOG.md > /tmp/release-notes.md
LINES=$(wc -l < /tmp/release-notes.md | tr -d ' ')
if [ "$LINES" -lt 2 ]; then
echo "Error: No release notes found between <!-- release:start --> and <!-- release:end --> markers in CHANGELOG.md"
exit 1
fi
echo "Extracted release notes for $VERSION ($LINES lines)"
- name: Cross-compile for all targets
run: |
mkdir -p /tmp/zero-release
node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/embed-skill-data.mts
build_hash="$(git rev-parse --short HEAD 2>/dev/null || echo unknown)"
build_asset() {
target="$1"
name="$2"
echo "Building $name (target: $target)..."
zig cc -target "$target" -std=c11 -D_POSIX_C_SOURCE=200809L -DZERO_BUILD_HASH="\"$build_hash\"" -Os -Inative/zero-c/include native/zero-c/src/*.c -o "/tmp/zero-release/$name"
chmod 755 "/tmp/zero-release/$name"
}
build_asset aarch64-macos zero-darwin-arm64
build_asset x86_64-macos zero-darwin-x64
build_asset aarch64-linux-gnu zero-linux-arm64
build_asset x86_64-linux-gnu zero-linux-x64
build_asset aarch64-linux-musl zero-linux-musl-arm64
build_asset x86_64-linux-musl zero-linux-musl-x64
build_asset aarch64-windows-gnu zero-win32-arm64.exe
build_asset x86_64-windows-gnu zero-win32-x64.exe
(cd /tmp/zero-release && shasum -a 256 zero-* > CHECKSUMS.txt)
- name: Smoke test release assets
run: |
set -eu
cd /tmp/zero-release
for asset in \
zero-darwin-arm64 \
zero-darwin-x64 \
zero-linux-arm64 \
zero-linux-x64 \
zero-linux-musl-arm64 \
zero-linux-musl-x64 \
zero-win32-arm64.exe \
zero-win32-x64.exe
do
test -s "$asset"
done
shasum -a 256 -c CHECKSUMS.txt
if [ "$(uname -s)" = "Darwin" ]; then
case "$(uname -m)" in
arm64)
./zero-darwin-arm64 --version
./zero-darwin-arm64 skills list --json
;;
x86_64)
./zero-darwin-x64 --version
./zero-darwin-x64 skills list --json
;;
*) echo "Skipping host binary smoke for unsupported macOS arch $(uname -m)" ;;
esac
fi
- name: Create GitHub Release
run: |
VERSION="${{ needs.check-release.outputs.version }}"
TAG="v$VERSION"
if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists, updating assets"
else
echo "Creating release $TAG..."
gh release create "$TAG" \
--title "$TAG" \
--notes-file /tmp/release-notes.md
fi
gh release upload "$TAG" \
/tmp/zero-release/zero-* \
/tmp/zero-release/CHECKSUMS.txt \
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}