name: Mobile source and packed release contracts on: workflow_dispatch: push: branches: - codex/native-core224-integration - codex/native-core225-integration permissions: contents: read jobs: source: runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v6 - name: Set up published Pantry and managed Bun uses: pantry-pm/pantry/packages/action@e632b04fb1a8093e7c940c1dbd8ae4fb9b09bf5d # v0.11.130 with: version: 0.11.130 install: 'false' packages: bun.com@1.4.4 git-scm.org - name: Install normal frozen workspace dependencies run: bun install --frozen-lockfile - name: Record the exact source and public dependency cohort run: | mkdir -p artifacts/mobile-source-contract git rev-parse HEAD > artifacts/mobile-source-contract/source-commit.txt bun --version > artifacts/mobile-source-contract/bun-version.txt sha256sum bun.lock pantry.lock > artifacts/mobile-source-contract/locks-before.sha256 bun -e "for (const name of ['craft-native', '@stacksjs/stx', '@stacksjs/components', 'bun-plugin-stx']) { const p = await Bun.file('node_modules/' + name + '/package.json').json(); console.log(name, p.version) }" > artifacts/mobile-source-contract/public-cohort.txt - name: Build packages imported by subpath run: | set -euo pipefail stacks_subpath_targets=$(bun .github/scripts/subpath-packages.ts) for pkg in $stacks_subpath_targets; do echo "::group::build @stacksjs/$pkg" (cd "storage/framework/core/$pkg" && bun run build) echo "::endgroup::" done - name: Lint the normal framework run: | set -o pipefail bun run lint 2>&1 | tee artifacts/mobile-source-contract/lint.log - name: Build the mobile package run: | set -o pipefail bun run --cwd storage/framework/core/mobile build 2>&1 | tee artifacts/mobile-source-contract/mobile-build.log - name: Run every mobile test run: | set -o pipefail bun test ./storage/framework/core/mobile/tests 2>&1 | tee artifacts/mobile-source-contract/mobile-tests.log - name: Verify the integrated native build and release configuration run: | set -o pipefail bun test ./storage/framework/core/actions/tests/ios-config.test.ts ./storage/framework/core/actions/tests/android-config.test.ts ./storage/framework/core/actions/tests/mobile-build-target.test.ts ./storage/framework/core/actions/tests/release-preflight.test.ts ./storage/framework/core/actions/tests/pantry-lock.test.ts 2>&1 | tee artifacts/mobile-source-contract/native-build-configuration.log - name: Verify repository tooling loads configuration without application initialization run: | set -o pipefail bun test ./storage/framework/core/defaults/tests/preloader.test.ts --test-name-pattern 'keeps repository' 2>&1 | tee artifacts/mobile-source-contract/repository-preloader.log bun test ./storage/framework/core/buddy/tests/project-setup.test.ts 2>&1 | tee artifacts/mobile-source-contract/repository-key-guards.log - name: Verify every published subpath and current workspace lock declaration run: | set -o pipefail bun test ./storage/framework/core/buddy/tests/subpath-entrypoints.test.ts ./storage/framework/core/buddy/tests/subpath-builds-are-listed.test.ts ./storage/framework/core/buddy/tests/lockfile-matches-manifests.test.ts 2>&1 | tee artifacts/mobile-source-contract/publication-registration.log - name: Typecheck the normal mobile package run: | set -o pipefail bun run --cwd storage/framework/core/mobile typecheck 2>&1 | tee artifacts/mobile-source-contract/mobile-typecheck.log - name: Verify router import boundaries in the normal package directory run: | set -o pipefail (cd storage/framework/core/router && bun test ./tests/import-graph.test.ts) 2>&1 | tee artifacts/mobile-source-contract/router-import-graph.log - name: Typecheck the normal framework run: | set -o pipefail bun run typecheck 2>&1 | tee artifacts/mobile-source-contract/framework-typecheck.log - name: Verify the normal publication declarations run: | set -o pipefail bun test ./tests/declared-dependencies.test.ts 2>&1 | tee artifacts/mobile-source-contract/declarations.log - name: Verify normal publication documentation contracts run: | set -o pipefail bun -e ' import { formatPreflightFailure, runPinnedChecks } from "./storage/framework/core/actions/src/release-preflight" const result = await runPinnedChecks({ cwd: process.cwd() }) console.log(JSON.stringify({ ran: result.ran, bypassed: result.bypassed, failures: result.failures.length })) if (result.bypassed || result.failures.length) { console.error(formatPreflightFailure(result.failures)) process.exit(1) } ' 2>&1 | tee artifacts/mobile-source-contract/release-preflight.log - name: Verify source lockfiles remain unchanged if: always() run: sha256sum --check artifacts/mobile-source-contract/locks-before.sha256 - name: Retain exact source gate observations if: always() uses: actions/upload-artifact@v4 with: name: mobile-source-contract path: artifacts/mobile-source-contract if-no-files-found: error packed-mobile: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v6 - name: Set up published Pantry and managed Bun uses: pantry-pm/pantry/packages/action@e632b04fb1a8093e7c940c1dbd8ae4fb9b09bf5d # v0.11.130 with: version: 0.11.130 install: 'false' packages: bun.com@1.4.4 git-scm.org - name: Install normal frozen workspace dependencies run: bun install --frozen-lockfile - name: Lint the packed consumer contract run: bunx --bun pickier run --mode lint .github/scripts/verify-packed-mobile-consumer.ts - name: Verify actual packed mobile declarations against the public cohort run: bun .github/scripts/verify-packed-mobile-consumer.ts - name: Verify actual packed framework root and CLI imports run: bun .github/scripts/verify-packed-mobile-consumer.ts --framework-root - name: Retain candidate manifests and the exact strict compiler result if: always() uses: actions/upload-artifact@v4 with: name: mobile-packed-contract path: artifacts/mobile-packed-contract if-no-files-found: error native-credentials: runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@v6 - name: Set up published Pantry and isolated native database services uses: pantry-pm/pantry/packages/action@e632b04fb1a8093e7c940c1dbd8ae4fb9b09bf5d # v0.11.130 with: version: 0.11.130 install: 'false' packages: bun.com@1.4.4 git-scm.org curl.se sqlite.org services: postgres@17.11 mysql@26.7.0 - name: Install normal frozen workspace dependencies run: bun install --frozen-lockfile - name: Build the ordinary published runtime entrypoints run: | set -euo pipefail stacks_subpath_targets=$(bun .github/scripts/subpath-packages.ts --runtime) for pkg in $stacks_subpath_targets; do (cd "storage/framework/core/$pkg" && bun run build) done - name: Verify real credential stamp precision and transaction rollback env: STACKS_TEST_POSTGRES_URL: ${{ env.POSTGRES_URL }} STACKS_TEST_MYSQL_URL: ${{ env.MYSQL_URL }} run: | set -euo pipefail : "${STACKS_TEST_POSTGRES_URL:?Pantry must export a PostgreSQL URL}" : "${STACKS_TEST_MYSQL_URL:?Pantry must export a MySQL URL}" mkdir -p artifacts/native-credentials git rev-parse HEAD > artifacts/native-credentials/source-commit.txt bun test ./storage/framework/core/auth/tests/password-reset-drivers.test.ts 2>&1 | tee artifacts/native-credentials/password-reset-drivers.log - name: Retain actual native credential observations if: always() uses: actions/upload-artifact@v4 with: name: native-credentials path: artifacts/native-credentials if-no-files-found: error