From 401aea884fbff8231ada71afab1db3da674e094c Mon Sep 17 00:00:00 2001 From: Dustin Hilgaertner Date: Sun, 5 Apr 2026 15:05:39 -0500 Subject: [PATCH 1/2] Add GitHub Actions CI workflow Two parallel jobs: fast unit tests (CrowCore) and full build with Ghostty framework caching by submodule SHA. Closes #58 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8cedef7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Test + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "16" + + - name: Run tests + run: swift test --package-path Packages/CrowCore + + build: + name: Build + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "16" + + - uses: mlugg/setup-zig@v2 + with: + version: 0.15.2 + + - name: Get Ghostty submodule SHA + id: ghostty-sha + run: echo "sha=$(git -C vendor/ghostty rev-parse HEAD)" >> "$GITHUB_OUTPUT" + + - name: Cache Ghostty framework + id: ghostty-cache + uses: actions/cache@v4 + with: + path: Frameworks + key: ghostty-${{ runner.os }}-${{ runner.arch }}-${{ steps.ghostty-sha.outputs.sha }} + + - name: Build Ghostty + if: steps.ghostty-cache.outputs.cache-hit != 'true' + run: make ghostty + + - name: Cache SPM dependencies + uses: actions/cache@v4 + with: + path: .build + key: spm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Package.swift', 'Packages/*/Package.swift') }} + restore-keys: | + spm-${{ runner.os }}-${{ runner.arch }}- + + - name: Generate build info + run: bash scripts/generate-build-info.sh + + - name: Build + run: swift build From 514565ee7276fb35b6cfe0eeaf9f3a6ecceb157a Mon Sep 17 00:00:00 2001 From: Dustin Hilgaertner Date: Sun, 5 Apr 2026 15:15:50 -0500 Subject: [PATCH 2/2] Fix Ghostty build by unsetting zig cache env vars setup-zig redirects ZIG_LOCAL_CACHE_DIR to the project root, but build-ghostty.sh expects the cache under vendor/ghostty/. Unsetting the env vars lets zig use its default local cache. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cedef7..b04ff38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,9 @@ jobs: - name: Build Ghostty if: steps.ghostty-cache.outputs.cache-hit != 'true' - run: make ghostty + run: | + unset ZIG_LOCAL_CACHE_DIR ZIG_GLOBAL_CACHE_DIR + make ghostty - name: Cache SPM dependencies uses: actions/cache@v4