Repository navigation
Migrate Codex integration to native hooks (Claude parity) (#40) #134
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| name: Swift Tests | |
| runs-on: macos-26 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Select Xcode 26.4.1 | |
| run: sudo xcode-select -s /Applications/Xcode_26.4.1.app | |
| - name: Show toolchain versions | |
| run: | | |
| swift --version | |
| xcodebuild -version | |
| - name: Determine Ghostty build metadata | |
| id: ghostty-meta | |
| run: | | |
| set -euo pipefail | |
| zig_version="$(awk -F'"' '/minimum_zig_version/ { print $2; exit }' ghostty/build.zig.zon)" | |
| if [ -z "$zig_version" ]; then | |
| echo "Failed to determine Ghostty Zig version" >&2 | |
| exit 1 | |
| fi | |
| case "$(uname -m)" in | |
| arm64) | |
| zig_arch="aarch64" | |
| ;; | |
| x86_64) | |
| zig_arch="x86_64" | |
| ;; | |
| *) | |
| echo "Unsupported macOS runner architecture: $(uname -m)" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| echo "zig_version=$zig_version" >> "$GITHUB_OUTPUT" | |
| echo "zig_arch=$zig_arch" >> "$GITHUB_OUTPUT" | |
| echo "zig_dir=$PWD/zig-${zig_arch}-macos-${zig_version}" >> "$GITHUB_OUTPUT" | |
| echo "ghostty_sha=$(git -C ghostty rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Zig toolchain | |
| id: zig-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.ghostty-meta.outputs.zig_dir }} | |
| key: ${{ runner.os }}-${{ steps.ghostty-meta.outputs.zig_arch }}-zig-${{ steps.ghostty-meta.outputs.zig_version }} | |
| - name: Install minisign | |
| if: steps.zig-cache.outputs.cache-hit != 'true' | |
| run: | | |
| set -euo pipefail | |
| if ! command -v minisign >/dev/null 2>&1; then | |
| brew install minisign | |
| fi | |
| - name: Install Zig required by Ghostty | |
| if: steps.zig-cache.outputs.cache-hit != 'true' | |
| env: | |
| ZIG_MINISIGN_PUBLIC_KEY: RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U | |
| run: | | |
| set -euo pipefail | |
| zig_archive="zig-${{ steps.ghostty-meta.outputs.zig_arch }}-macos-${{ steps.ghostty-meta.outputs.zig_version }}.tar.xz" | |
| zig_base_url="https://ziglang.org/download/${{ steps.ghostty-meta.outputs.zig_version }}" | |
| curl -L "${zig_base_url}/${zig_archive}" -o zig.tar.xz | |
| curl -L "${zig_base_url}/${zig_archive}.minisig" -o zig.tar.xz.minisig | |
| minisign -Vm zig.tar.xz -x zig.tar.xz.minisig -P "$ZIG_MINISIGN_PUBLIC_KEY" | |
| tar -xf zig.tar.xz | |
| - name: Add Zig to PATH | |
| run: echo "${{ steps.ghostty-meta.outputs.zig_dir }}" >> "$GITHUB_PATH" | |
| - name: Cache Ghostty build outputs | |
| id: ghostty-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ghostty/.zig-cache | |
| ghostty/zig-out | |
| ghostty/macos/GhosttyKit.xcframework | |
| key: ${{ runner.os }}-${{ steps.ghostty-meta.outputs.zig_arch }}-ghostty-${{ steps.ghostty-meta.outputs.zig_version }}-${{ steps.ghostty-meta.outputs.ghostty_sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ steps.ghostty-meta.outputs.zig_arch }}-ghostty-${{ steps.ghostty-meta.outputs.zig_version }}- | |
| - name: Build GhosttyKit xcframework | |
| if: steps.ghostty-cache.outputs.cache-hit != 'true' | |
| run: | | |
| zig build -Demit-xcframework=true -Demit-macos-app=false -Dxcframework-target=native -Doptimize=ReleaseFast | |
| working-directory: ghostty | |
| - name: Run Swift package tests | |
| run: swift test |