| 1 | name: Pet conformance |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | paths: |
| 6 | - 'pet/**' |
| 7 | - 'crates/tui/src/tui/pet_watch/**' |
| 8 | - 'crates/tui/src/tui/ambient_life/pet_*' |
| 9 | - 'crates/tui/src/tui/ambient_life/whale-points.tsv' |
| 10 | - 'npm/runtime-sdk/**' |
| 11 | - '.github/workflows/pet.yml' |
| 12 | workflow_dispatch: |
| 13 | |
| 14 | permissions: |
| 15 | contents: read |
| 16 | |
| 17 | concurrency: |
| 18 | group: pet-${{ github.event.pull_request.number || github.ref }} |
| 19 | cancel-in-progress: true |
| 20 | |
| 21 | jobs: |
| 22 | portable: |
| 23 | runs-on: ubuntu-latest |
| 24 | timeout-minutes: 15 |
| 25 | steps: |
| 26 | - uses: actions/checkout@v7 |
| 27 | - uses: actions/setup-node@v7 |
| 28 | with: |
| 29 | node-version: '22' |
| 30 | cache: npm |
| 31 | cache-dependency-path: pet/package-lock.json |
| 32 | - uses: dtolnay/rust-toolchain@stable |
| 33 | - run: npm --prefix pet ci --ignore-scripts |
| 34 | - run: npm --prefix pet run check |
| 35 | - run: npm --prefix pet run sync |
| 36 | - name: Embedded sources match canonical core |
| 37 | run: git diff --exit-code -- crates/tui/src/tui/pet_watch/pet-native.js pet/ios/Resources |
| 38 | # The authored body is checked in five times and nothing kept the copies |
| 39 | # in step, so the Rust core silently carried a different whale from every |
| 40 | # other surface and conformance never passed. Compare them directly: no |
| 41 | # sync step produces these, so `git diff` cannot catch the drift. |
| 42 | - name: One whale body across every surface |
| 43 | run: | |
| 44 | canonical=crates/tui/src/tui/ambient_life/whale-points.tsv |
| 45 | for copy in pet/whale-points.tsv pet/public/whale-points.tsv pet/rs/whale-points.tsv; do |
| 46 | diff -q "$canonical" "$copy" || { |
| 47 | echo "::error file=$copy::diverged from $canonical; the Rust core is canonical" |
| 48 | exit 1 |
| 49 | } |
| 50 | done |
| 51 | - run: cargo fetch --locked --manifest-path pet/tui/Cargo.toml |
| 52 | - name: TypeScript and Rust parity, including reduced motion |
| 53 | run: ./pet/verify.sh --no-swift |
| 54 | recorder: |
| 55 | name: recorder (${{ matrix.os }}) |
| 56 | strategy: |
| 57 | fail-fast: false |
| 58 | matrix: |
| 59 | os: [macos-latest, windows-latest] |
| 60 | runs-on: ${{ matrix.os }} |
| 61 | timeout-minutes: 45 |
| 62 | steps: |
| 63 | - uses: actions/checkout@v7 |
| 64 | - uses: actions/setup-node@v7 |
| 65 | with: |
| 66 | node-version: '22' |
| 67 | cache: npm |
| 68 | cache-dependency-path: pet/package-lock.json |
| 69 | - run: npm --prefix pet ci --ignore-scripts |
| 70 | - run: npm --prefix pet run check |
| 71 | - uses: dtolnay/rust-toolchain@stable |
| 72 | if: runner.os == 'macOS' |
| 73 | - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 |
| 74 | if: runner.os == 'macOS' |
| 75 | - name: Build the standalone shared owner and verify its transport |
| 76 | if: runner.os == 'macOS' |
| 77 | run: | |
| 78 | cargo build --locked -j 2 -p codewhale-tui --bin codewhale-tui |
| 79 | python3 pet/scripts/check-shared.py target/debug/codewhale-tui |
| 80 | - name: Build and exercise the Apple host and PCM boundary |
| 81 | if: runner.os == 'macOS' |
| 82 | run: PET_OWNER_BINARY="$PWD/target/debug/codewhale-tui" ./pet/scripts/check-apple.sh |
| 83 | - name: Package the locally signed macOS app |
| 84 | if: runner.os == 'macOS' |
| 85 | run: ditto -c -k --keepParent pet/macos/CodewhalePet.app codewhale-pet-macos.zip |
| 86 | - uses: actions/upload-artifact@v7 |
| 87 | if: runner.os == 'macOS' |
| 88 | with: |
| 89 | name: codewhale-pet-macos |
| 90 | path: codewhale-pet-macos.zip |
| 91 | if-no-files-found: error |
| 92 | android: |
| 93 | runs-on: ubuntu-latest |
| 94 | timeout-minutes: 25 |
| 95 | steps: |
| 96 | - uses: actions/checkout@v7 |
| 97 | - uses: actions/setup-java@v6 |
| 98 | with: |
| 99 | distribution: temurin |
| 100 | java-version: '17' |
| 101 | - name: Enable emulator acceleration on the disposable runner |
| 102 | run: sudo chmod a+rw /dev/kvm |
| 103 | - uses: reactivecircus/android-emulator-runner@v2.38.0 |
| 104 | with: |
| 105 | api-level: 35 |
| 106 | arch: x86_64 |
| 107 | target: google_apis |
| 108 | profile: pixel_7 |
| 109 | disable-animations: false |
| 110 | working-directory: pet/android |
| 111 | script: ./gradlew --no-daemon assembleDebug connectedDebugAndroidTest lintDebug |
| 112 | - uses: actions/upload-artifact@v7 |
| 113 | if: always() |
| 114 | with: |
| 115 | name: codewhale-pet-android |
| 116 | path: | |
| 117 | pet/android/build/outputs/apk/debug/*.apk |
| 118 | pet/android/build/reports/androidTests/ |
| 119 | pet/android/build/reports/lint-results-debug.* |
| 120 |