diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5c01e48 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + swift: + name: Swift build and test + runs-on: macos-15 + timeout-minutes: 20 + + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Select Xcode 26 + shell: bash + run: | + set -euo pipefail + xcode_app="$(find /Applications -maxdepth 1 -name 'Xcode_26*.app' -print | sort | tail -n 1)" + if [[ -z "$xcode_app" ]]; then + echo "Xcode 26 is required for Swift tools 6.2 but was not found." >&2 + exit 1 + fi + echo "DEVELOPER_DIR=$xcode_app/Contents/Developer" >> "$GITHUB_ENV" + echo "Selected $xcode_app" + + - name: Print tool versions + run: | + xcodebuild -version + swift --version + + - name: Build + run: swift build + + - name: Test + run: swift test diff --git a/README.md b/README.md index 25420ae..9b0c5cb 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ When launching a test build that someone might manually test, pass `CATCH_GLOBAL ## Verification And Debugging +### Continuous Integration + +`.github/workflows/build.yml` runs on pushes to `main` and pull requests to `main`. It selects an installed Xcode 26 toolchain for Swift tools 6.2, then runs `swift build` and `swift test`. + +The release packaging workflow stays separate in `.github/workflows/release.yml` and only runs for `v*` tags or manual dispatch. To make the per-commit build block merges, a repository admin still needs to add the `Swift build and test` check to the `main` branch protection rule in GitHub settings. + ### SwiftUI Previews Open the package in Xcode and select the `CatchKit` scheme before refreshing SwiftUI previews. `CatchKit` is exposed as a dynamic library product so previews can build through a framework scheme; using the `Catch` executable scheme can produce Xcode's `ENABLE_DEBUG_DYLIB` preview error.