feat(pack): ship a library as interface + prebuilt binaries (#433) #587
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci-windows-e2e | |
| # The e2e suite on Windows, split out of ci-windows.yml (where it was 9.7 of | |
| # the job's 20.4 min) and sharded across two runners — same shape as | |
| # ci-linux-e2e.yml. Shares the cache lineage in .github/actions/bootstrap-mcpp, | |
| # so each shard restores a warm sandbox and pays one incremental `mcpp build`. | |
| # | |
| # Paired workflows: ci-windows.yml (build + unit + package, toolchains + | |
| # regressions), ci-linux-e2e.yml, ci-macos-e2e.yml. | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e: | |
| name: e2e ${{ matrix.shard }}/2 (windows x64, self-host) | |
| runs-on: windows-latest | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2] | |
| env: | |
| MCPP_HOME: C:\Users\runneradmin\.mcpp | |
| # Round-robin slice of tests/e2e (see run_all.sh). | |
| E2E_SHARD: ${{ matrix.shard }}/2 | |
| # NOTE: do NOT force MCPP_VERBOSE here. The e2e suite includes tests that | |
| # assert mcpp's DEFAULT (quiet) output — e.g. 48_build_error_output and | |
| # 53_namespaced_cache_label — which forced verbose would break. | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/bootstrap-mcpp | |
| - name: Build mcpp from source (self-host) | |
| shell: bash | |
| run: | | |
| export MCPP_VENDORED_XLINGS="$XLINGS_BIN" | |
| "$MCPP" build | |
| # Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is | |
| # restored from cache and keeps a directory per build fingerprint, | |
| # so after a version bump the freshly built binary sits alongside | |
| # the previous release's. `find | head -1` returned whichever the | |
| # directory walk hit first — which is how a 0.0.106 build ran the | |
| # 0.0.105 binary and failed 01_help_and_version. | |
| MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \ | |
| | sort -rn | head -1 | cut -d" " -f2-) | |
| test -n "$MCPP_SELF" || { echo "FAIL: no mcpp.exe"; exit 1; } | |
| MCPP_SELF=$(cd "$(dirname "$MCPP_SELF")" && pwd)/$(basename "$MCPP_SELF") | |
| "$MCPP_SELF" --version | |
| echo "MCPP_SELF=$MCPP_SELF" >> "$GITHUB_ENV" | |
| # MinGW-w64 GCC (xim:mingw-gcc). Installed here so the `mingw` capability | |
| # is GRANTED rather than left to whatever the shared sandbox cache happens | |
| # to carry: e2e 256 packs an MSVC leg and a MinGW leg into one package, | |
| # which is the only place `lib/` keyed by triple is proven with two | |
| # DIFFERENT artifact names (mathkit.lib beside libmathkit.a). Without this | |
| # step that test skips, and a skipped test in a green suite reads exactly | |
| # like a passing one. | |
| # | |
| # Not `|| true`: if the payload cannot be installed the capability quietly | |
| # disappears and the coverage goes with it, which is the failure mode this | |
| # step exists to prevent. | |
| - name: "Toolchain: MinGW payload for the fat-package e2e" | |
| shell: bash | |
| run: | | |
| export MCPP_VENDORED_XLINGS="$XLINGS_BIN" | |
| "$MCPP_SELF" toolchain install mingw 16.1.0 | |
| # Verified through the SAME two locations run_all.sh probes — checking | |
| # only one of them would let the step pass while the capability stays | |
| # ungranted, which is the shape of a green run that tested nothing. | |
| found="" | |
| for c in "${MCPP_HOME:-$HOME/.mcpp}"/registry/data/xpkgs/xim-x-mingw-gcc/*/bin/g++.exe \ | |
| "$HOME"/.xlings/data/xpkgs/xim-x-mingw-gcc/*/bin/g++.exe; do | |
| [[ -x "$c" ]] && { found="$c"; break; } | |
| done | |
| test -n "$found" || { echo "FAIL: mingw installed but not where run_all.sh looks"; exit 1; } | |
| echo "mingw payload: $found" | |
| - name: E2E suite | |
| shell: bash | |
| # Fail-fast on hung tests instead of burning the whole job budget. | |
| # Per-test 600s timeout lives in run_all.sh. | |
| timeout-minutes: 25 | |
| run: | | |
| # The RELEASED mcpp this job bootstrapped from, kept for e2e 252: the | |
| # claim that an older client can still build against a package the PR | |
| # produces is only worth making if something checks it against a real | |
| # old binary. Captured before $MCPP is repointed at the fresh build. | |
| export MCPP_BOOT="${MCPP:-$MCPP_BOOT}" | |
| export MCPP="$MCPP_SELF" | |
| export MCPP_VENDORED_XLINGS="$XLINGS_BIN" | |
| export MCPP_E2E_TOOLCHAIN_MIRROR=GLOBAL | |
| "$MCPP_SELF" self config --mirror GLOBAL | |
| "$MCPP_SELF" toolchain default llvm@20.1.7 | |
| bash tests/e2e/run_all.sh |