From 95d21129c83feebfc9ad744b987ec98b3cb93814 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 15:07:44 +0000 Subject: [PATCH 1/2] ci: pin Xcode 26.6, build for iOS, stop tracking Package.resolved CI and Docs ran on macos-latest with the newest Xcode; both now run on macos-26 with Xcode 26.6 via DEVELOPER_DIR, as the apps do. The test job adds an iOS Simulator build (Package.swift declares iOS 18). The tracked root Package.resolved pinned ImagoKit 0.2.0 while the manifest accepts 0.2.0..<1.0.0 and consumers ignore it; it is untracked and ignored so CI resolves what a consumer resolves. docs.yml no longer says the kit has no package dependencies, and the lint checkout leaves the Node 20 major. Fixes mac4DSTEM/DiffractoKit#15 Done: CI pins its toolchain, builds for iOS and resolves ImagoKit like a consumer. Next: Paul re-runs Docs for the newest tag once this is merged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VkKZEWRjvbRGe75ep8jhBn --- .github/workflows/ci.yml | 26 ++++++++++++++++---------- .github/workflows/docs.yml | 13 ++++++++----- .gitignore | 1 + Package.resolved | 15 --------------- 4 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 Package.resolved diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a9cc11..d9a20ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ -# DiffractoKit CI: the gate (`swift test -c release`), the consumer check, the README consumer and the example. +# DiffractoKit CI: the gate (`swift test -c release`), the consumer check, the README consumer, the example and an iOS +# Simulator build. # -# The package's floor is macOS 15 / iOS 18 (since 0.2.0) with tools 6.2; `macos-latest` -# is used with the newest Xcode on the image selected. On 2026-10-15 that was Xcode 26.6, whose compiler (not the local Swift -# 6.4) crashed in its SIL ownership verifier on `catch SomeError.someCase { ... }` clauses in the tests (run 38747583963): the -# tests therefore bind the error (`catch let caught as SomeError`) and match the case in the body. +# The package's floor is macOS 15 / iOS 18 (since 0.2.0) with tools 6.2; the macos-26 image with Xcode 26.6 is pinned below. +# Xcode 26.6's compiler crashed in its SIL ownership verifier on `catch SomeError.someCase { ... }` clauses in the tests +# (run 38747583963, 2026-10-15): the tests therefore bind the error (`catch let caught as SomeError`) and match the case in +# the body. Package.resolved is not tracked, so CI resolves the newest ImagoKit the manifest's range allows, as a consumer does. # # THE PINS' PYTHON ORACLES ARE NOT RUN HERE. The tests read committed fixtures (Tests/*/Fixtures/*.json, generated by # tools/*/pins.py against pymatgen 2026.9.24, pymatgen-core 2026.9.23, spglib 2.8.0, NumPy 2.5.4, SciPy 1.18.1 and py4DSTEM @@ -25,16 +26,19 @@ concurrency: group: ci-${{ github.ref }} cancel-in-progress: true +env: + # Pinned like the apps: the macos-26 image's Xcode 26.6 (Swift 6.3, macOS 26 SDK). Bump on purpose. + DEVELOPER_DIR: /Applications/Xcode_26.6.app/Contents/Developer + jobs: test: - runs-on: macos-latest + runs-on: macos-26 timeout-minutes: 90 steps: - uses: actions/checkout@v7 - - name: Select the newest Xcode + - name: Toolchain on record run: | - xcode=$(ls -d /Applications/Xcode*.app | sort -V | tail -1) - sudo xcode-select -s "$xcode" + xcode-select -p swift --version - name: Gate (swift test, release) run: swift test -c release @@ -46,6 +50,8 @@ jobs: run: | swift build -c release --product diffracto-example "$(swift build -c release --show-bin-path)/diffracto-example" + - name: Build the libraries for iOS (Simulator, not run) + run: xcodebuild -scheme DiffractoKit-Package -destination 'generic/platform=iOS Simulator' -quiet build version: name: CHANGELOG version matches the tag @@ -74,7 +80,7 @@ jobs: name: Lint (shared SwiftLint and SwiftFormat config) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: SwiftLint run: docker run --rm -v "$PWD:/work" -w /work --entrypoint swiftlint ghcr.io/realm/swiftlint:0.65.1 lint --strict --quiet - name: SwiftFormat diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 89df0ae..b2ae61a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,7 +2,7 @@ # published to GitHub Pages at https://mac4dstem.github.io/DiffractoKit/documentation/ on every tag. # On a pull request the site is built and uploaded as an artifact only, so a broken catalog fails before the tag. # -# No swift-docc-plugin: the kit takes no package dependencies. `xcodebuild docbuild` builds the archives +# No swift-docc-plugin: the kit adds no dependency for its docs (its one package dependency is ImagoKit). `xcodebuild docbuild` builds the archives # from the package's own schemes; `docc merge` (Xcode 16+) joins them. Needs Pages enabled with source "GitHub Actions" # (repository Settings > Pages). Copied from CuboKit's pattern; the module list is read from the .docc catalogs. name: Docs @@ -23,16 +23,19 @@ concurrency: group: docs-${{ github.ref }} cancel-in-progress: true +env: + # Pinned like the apps: the macos-26 image's Xcode 26.6 (Swift 6.3, macOS 26 SDK). Bump on purpose. + DEVELOPER_DIR: /Applications/Xcode_26.6.app/Contents/Developer + jobs: build: - runs-on: macos-latest + runs-on: macos-26 timeout-minutes: 60 steps: - uses: actions/checkout@v7 - - name: Select the newest Xcode + - name: Toolchain on record run: | - xcode=$(ls -d /Applications/Xcode*.app | sort -V | tail -1) - sudo xcode-select -s "$xcode" + xcode-select -p xcodebuild -version - name: Build the site run: tools/build-docs.sh .docs-site /DiffractoKit diff --git a/.gitignore b/.gitignore index cbb0eff..5dcc0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ tools/benchmarks/.build/ # Local session rules, kept on disk only CLAUDE.md .claude/ +/Package.resolved diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 3247d08..0000000 --- a/Package.resolved +++ /dev/null @@ -1,15 +0,0 @@ -{ - "originHash" : "50c6c155fde616d95d664e60390bc3a98df42b7ca33b93d0821665b82325e57d", - "pins" : [ - { - "identity" : "imagokit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/mac4DSTEM/ImagoKit", - "state" : { - "revision" : "2af2133b27b54043ffd6655ba2112edfce533f46", - "version" : "0.2.0" - } - } - ], - "version" : 3 -} From f942cb74ae1b5a674ffd8c2a09be3e34c77da210 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 16:28:27 +0000 Subject: [PATCH 2/2] ci: run the extra macOS builds after merge, not on every pull request The free plan's macOS runners are scarce. The required test job keeps its name and still runs on every pull request; the added consumer, iOS and URL-resolution builds move to a job that runs on push, tag and by hand. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VkKZEWRjvbRGe75ep8jhBn --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9a20ee..dcf0d06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,15 @@ jobs: run: | swift build -c release --product diffracto-example "$(swift build -c release --show-bin-path)/diffracto-example" + + post-merge: + name: iOS build (after merge) + # Not on pull requests: the free plan's macOS runners are scarce, so the extra builds run on main, tags and by hand. + if: github.event_name != 'pull_request' + runs-on: macos-26 + timeout-minutes: 90 + steps: + - uses: actions/checkout@v7 - name: Build the libraries for iOS (Simulator, not run) run: xcodebuild -scheme DiffractoKit-Package -destination 'generic/platform=iOS Simulator' -quiet build