Gitignore .build/ at any depth #1267
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: | |
| - "**" | |
| schedule: | |
| - cron: "3 3 * * 2" # 3:03 AM, every Tuesday | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # TODO: Re-enable when --ifdef no-indent works as intended | |
| # lint: | |
| # name: Lint | |
| # runs-on: macos-latest | |
| # steps: | |
| # - name: Git Checkout | |
| # uses: actions/checkout@v5 | |
| # - name: Install SwiftFormat | |
| # run: | | |
| # brew unlink swiftformat | |
| # brew install swiftformat --HEAD | |
| # - name: SwiftFormat Lint | |
| # run: swiftformat --lint . --reporter github-actions-log | |
| lint-podspec: | |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]') | |
| name: Lint Podspec | |
| runs-on: macos-26 | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # required to be able to find Git tags | |
| - name: Select Xcode | |
| run: sudo xcodes select 26.3 | |
| - name: Install Runtimes | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 15 | |
| max_attempts: 3 | |
| command: xcodebuild -downloadAllPlatforms | |
| - name: Lint Podspec | |
| run: | | |
| set -eo pipefail | |
| export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) | |
| pod lib lint SwiftUIIntrospect.podspec --allow-warnings --skip-tests | |
| ci: | |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]') | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runner || 'macos-26' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # iOS (iPhone) | |
| - { name: "iOS 15.5", runtime: "iOS 15.5", device: "iPhone 13 Pro" } | |
| - { name: "iOS 16.4", runtime: "iOS 16.4", device: "iPhone 14 Pro" } | |
| - { name: "iOS 17.5", runtime: "iOS 17.5", device: "iPhone 15 Pro" } | |
| - { name: "iOS 18.5", runtime: "iOS 18.5", device: "iPhone 16 Pro", runner: macos-15 } | |
| - { name: "iOS 26.2", runtime: "iOS 26.2", device: "iPhone 17 Pro" } | |
| # iPadOS | |
| - { name: "iPadOS 15.5", runtime: "iOS 15.5", device: "iPad Pro (11-inch) (3rd generation)" } | |
| - { name: "iPadOS 16.4", runtime: "iOS 16.4", device: "iPad Pro (11-inch) (4th generation)" } | |
| - { name: "iPadOS 17.5", runtime: "iOS 17.5", device: "iPad Pro 11-inch (M4)" } | |
| - { name: "iPadOS 18.5", runtime: "iOS 18.5", device: "iPad Pro 11-inch (M4)", runner: macos-15 } | |
| - { name: "iPadOS 26.2", runtime: "iOS 26.2", device: "iPad Pro 11-inch (M4)" } | |
| # macOS / macCatalyst | |
| - { name: "macCatalyst 15", destination: "platform=macOS,variant=Mac Catalyst", runner: macos-15 } | |
| - { name: "macCatalyst 26", destination: "platform=macOS,variant=Mac Catalyst" } | |
| - { name: "macOS 15", destination: "platform=macOS", runner: macos-15 } | |
| - { name: "macOS 26", destination: "platform=macOS" } | |
| # tvOS | |
| - { name: "tvOS 15.4", runtime: "tvOS 15.4", device: "Apple TV" } | |
| - { name: "tvOS 16.4", runtime: "tvOS 16.4", device: "Apple TV" } | |
| - { name: "tvOS 17.5", runtime: "tvOS 17.5", device: "Apple TV" } | |
| - { name: "tvOS 18.5", runtime: "tvOS 18.5", device: "Apple TV", runner: macos-15 } | |
| - { name: "tvOS 26.2", runtime: "tvOS 26.2", device: "Apple TV" } | |
| # visionOS | |
| - { name: "visionOS 1.2", runtime: "visionOS 1.2", device: "Apple Vision Pro (at 2732x2048)" } | |
| - { name: "visionOS 2.5", runtime: "visionOS 2.5", device: "Apple Vision Pro (at 2732x2048)", runner: macos-15 } | |
| - { name: "visionOS 26.2", runtime: "visionOS 26.2", device: "Apple Vision Pro" } | |
| # watchOS (build-only, no test support) | |
| - { name: "watchOS 8.5", runtime: "watchOS 8.5", device: "Apple Watch Series 7 (45mm)", build_only: true } | |
| - { name: "watchOS 9.4", runtime: "watchOS 9.4", device: "Apple Watch Series 8 (45mm)", build_only: true } | |
| - { name: "watchOS 10.5", runtime: "watchOS 10.5", device: "Apple Watch Series 9 (45mm)", build_only: true } | |
| - { name: "watchOS 11.5", runtime: "watchOS 11.5", device: "Apple Watch Series 10 (42mm)", build_only: true, runner: macos-15 } | |
| - { name: "watchOS 26.2", runtime: "watchOS 26.2", device: "Apple Watch Series 11 (42mm)", build_only: true } | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v5 | |
| - name: Select Xcode | |
| run: sudo xcodes select 26.3 | |
| - name: Install ${{ matrix.runtime }} Runtime | |
| if: matrix.runtime | |
| uses: nick-fields/retry@v3 | |
| with: | |
| timeout_minutes: 10 | |
| max_attempts: 3 | |
| command: | | |
| RUNTIME="${{ matrix.runtime }}" | |
| if ! xcodes runtimes 2>/dev/null | grep -qF "$RUNTIME (Installed)"; then | |
| sudo xcodes runtimes install "$RUNTIME" --aria2 $(which aria2c) | |
| fi | |
| - name: Create Simulator | |
| if: matrix.device | |
| run: | | |
| set -eo pipefail | |
| xcrun simctl delete all | |
| # Look up runtime identifier by display name (handles internal names like xrOS for visionOS) | |
| RUNTIME="${{ matrix.runtime }}" | |
| RUNTIME_ID=$(xcrun simctl list runtimes -j | jq -r --arg name "$RUNTIME" '.runtimes[] | select(.isAvailable) | select(.name == $name) | .identifier') | |
| if [ -z "$RUNTIME_ID" ] || [ "$RUNTIME_ID" = "null" ]; then | |
| echo "::error::Runtime '$RUNTIME' not found. Available:" | |
| xcrun simctl list runtimes | |
| exit 1 | |
| fi | |
| echo "Runtime: $RUNTIME_ID" | |
| # Look up device type by display name, with fallback identifier construction | |
| DEVICE_TYPE=$(xcrun simctl list devicetypes -j | jq -r --arg name "${{ matrix.device }}" '.devicetypes[] | select(.name == $name) | .identifier') | |
| if [ -z "$DEVICE_TYPE" ] || [ "$DEVICE_TYPE" = "null" ]; then | |
| DEVICE_TYPE="com.apple.CoreSimulator.SimDeviceType.$(echo "${{ matrix.device }}" | sed 's/[()]//g; s/ */-/g; s/[^A-Za-z0-9-]//g')" | |
| echo "Device type not found by name, using fallback: $DEVICE_TYPE" | |
| fi | |
| UDID=$(xcrun simctl create "${{ matrix.device }}" "$DEVICE_TYPE" "$RUNTIME_ID") | |
| echo "SIM_UDID=$UDID" >> "$GITHUB_ENV" | |
| echo "Created simulator: ${{ matrix.device }} -> $UDID" | |
| - name: Build Showcase | |
| if: ${{ !matrix.build_only }} | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build \ | |
| -scheme Showcase \ | |
| -destination "${{ matrix.destination || format('id={0}', env.SIM_UDID) }}" \ | |
| -configuration Debug \ | |
| | xcbeautify | |
| - name: Build Library | |
| if: ${{ matrix.build_only == true }} | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build \ | |
| -scheme SwiftUIIntrospect \ | |
| -destination "id=${{ env.SIM_UDID }}" \ | |
| -configuration Debug \ | |
| | xcbeautify | |
| - name: Run Tests | |
| if: ${{ !matrix.build_only }} | |
| run: | | |
| set -eo pipefail | |
| xcodebuild test \ | |
| -scheme SwiftUIIntrospectTests \ | |
| -destination "${{ matrix.destination || format('id={0}', env.SIM_UDID) }}" \ | |
| -configuration Debug \ | |
| | xcbeautify | |
| framework-archiving: | |
| if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]') | |
| name: Archive Framework (${{ matrix.platform }}) | |
| runs-on: macos-26 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { platform: iOS, destination: "generic/platform=iOS" } | |
| - { platform: macCatalyst, destination: "platform=macOS,variant=Mac Catalyst" } | |
| - { platform: macOS, destination: "generic/platform=macOS" } | |
| - { platform: tvOS, destination: "generic/platform=tvOS" } | |
| - { platform: visionOS, destination: "generic/platform=visionOS" } | |
| - { platform: watchOS, destination: "generic/platform=watchOS" } | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v5 | |
| - name: Select Xcode | |
| run: sudo xcodes select 26.3 | |
| - name: Archive Framework | |
| run: | | |
| xcodebuild archive \ | |
| -scheme SwiftUIIntrospectTestFramework \ | |
| -destination "${{ matrix.destination }}" \ | |
| -archivePath .build/archiving/${{ matrix.platform }} \ | |
| SKIP_INSTALL=NO \ | |
| BUILD_LIBRARY_FOR_DISTRIBUTION=YES |