Commit 4fcf49a644
Verified · cmc
Layout: unified · split
.github/workflows/build.yml added +78
| @@ -0,0 +1,78 @@ | |||
| 1 | name: Build | ||
| 2 | |||
| 3 | # Compile gate for the GitHub mirror. builds.sr.ht is the primary remote for | ||
| 4 | # this project but has no macOS images, so xcodebuild cannot run there; this job | ||
| 5 | # compiles the app on a GitHub-hosted macOS runner instead. | ||
| 6 | # | ||
| 7 | # This runs `xcodebuild build`, not `test`: the project has no test target yet | ||
| 8 | # (planned for v5.0.0 in RELEASE_ROADMAP.md). When a test target and test plan | ||
| 9 | # exist, switch the final step to `xcodebuild test -testPlan <name>` and rename | ||
| 10 | # this workflow — the rest of the setup already matches a test run. | ||
| 11 | # | ||
| 12 | # pull_request only, plus manual dispatch. GitHub builds the merge result (PR | ||
| 13 | # merged into main), so a green PR validates exactly what will land on main. | ||
| 14 | # Note: this repo currently also pushes directly to main for releases, and those | ||
| 15 | # pushes are NOT gated here — add a `push: { branches: [main] }` trigger below if | ||
| 16 | # you want direct-to-main commits covered too. | ||
| 17 | # | ||
| 18 | # paths-ignore skips prose-only changes. Both globs are single-star, so they | ||
| 19 | # match the repo root and Docs/ but nothing deeper — a .md that ever lands inside | ||
| 20 | # a source directory still builds. | ||
| 21 | on: | ||
| 22 | pull_request: | ||
| 23 | paths-ignore: ['*.md', 'Docs/*.md'] | ||
| 24 | workflow_dispatch: | ||
| 25 | |||
| 26 | # The job only reads code; drop the default read-write GITHUB_TOKEN scope. | ||
| 27 | permissions: | ||
| 28 | contents: read | ||
| 29 | |||
| 30 | concurrency: | ||
| 31 | group: build-${{ github.ref }} | ||
| 32 | cancel-in-progress: true | ||
| 33 | |||
| 34 | jobs: | ||
| 35 | build: | ||
| 36 | name: xcodebuild build | ||
| 37 | # macos-latest still points at macOS 15, which lacks the iOS 26 SDK this app | ||
| 38 | # targets (deployment target 26.2). | ||
| 39 | runs-on: macos-26 | ||
| 40 | |||
| 41 | steps: | ||
| 42 | - uses: actions/checkout@v7 | ||
| 43 | |||
| 44 | - name: Show toolchain | ||
| 45 | run: | | ||
| 46 | xcodebuild -version | ||
| 47 | swift --version | ||
| 48 | |||
| 49 | - name: Select simulator | ||
| 50 | id: sim | ||
| 51 | run: | | ||
| 52 | set -euo pipefail | ||
| 53 | udid=$(xcrun simctl list devices available --json \ | ||
| 54 | | jq -r '[.devices[][] | select(.name | startswith("iPhone"))] | first | .udid') | ||
| 55 | if [ -z "$udid" ] || [ "$udid" = "null" ]; then | ||
| 56 | echo "No available iPhone simulator on this image" >&2 | ||
| 57 | xcrun simctl list devices available >&2 | ||
| 58 | exit 1 | ||
| 59 | fi | ||
| 60 | echo "udid=$udid" >> "$GITHUB_OUTPUT" | ||
| 61 | |||
| 62 | - name: Build | ||
| 63 | run: | | ||
| 64 | set -o pipefail | ||
| 65 | xcodebuild build \ | ||
| 66 | -project DomainDig.xcodeproj \ | ||
| 67 | -scheme DomainDig \ | ||
| 68 | -destination "id=${{ steps.sim.outputs.udid }}" \ | ||
| 69 | -resultBundlePath BuildResults.xcresult \ | ||
| 70 | CODE_SIGNING_ALLOWED=NO | ||
| 71 | |||
| 72 | - name: Upload results | ||
| 73 | if: failure() | ||
| 74 | uses: actions/upload-artifact@v4 | ||
| 75 | with: | ||
| 76 | name: build-results | ||
| 77 | path: BuildResults.xcresult | ||
| 78 | retention-days: 7 | ||