Renamed repository to swift-prefs #413
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: build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**/*.md' # .md files anywhere in the repo | |
| - '**/LICENSE' # LICENSE files anywhere in the repo | |
| - '**/.gitignore' # .gitignore files anywhere in the repo | |
| - '**/*.png' # .png image files anywhere in the repo | |
| - '**/*.pdf' # .pdf files anywhere in the repo | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**/*.md' # .md files anywhere in the repo | |
| - '**/LICENSE' # LICENSE files anywhere in the repo | |
| - '**/.gitignore' # .gitignore files anywhere in the repo | |
| - '**/*.png' # .png image files anywhere in the repo | |
| - '**/*.pdf' # .pdf files anywhere in the repo | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '15 13 * * *' # once a day @ 2:15am UTC (7:15am PST) | |
| env: | |
| SCHEME: "swift-prefs" | |
| jobs: | |
| macOS: | |
| name: macOS | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| macCatalyst: | |
| name: macCatalyst | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| # skip unit tests - swift macro testing seems to be broken in Xcode 26.0 without an obvious workaround | |
| # - name: Unit Tests | |
| # run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| iOS: | |
| name: iOS | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Bootstrap Platforms | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcrun simctl list | |
| - name: Download Platform | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcodebuild -downloadPlatform iOS | |
| - name: Build | |
| run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=iOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| # skip unit tests - swift macro testing seems to be broken in Xcode 26.0 without an obvious workaround | |
| # - name: Prepare Destination Device Name | |
| # id: destnameprep | |
| # # As of GitHub's updates to the macOS-15 runner summer 2025, randomly Xcode may not list any simulators. | |
| # # No idea why. Seems like a bug or runner config issue. So to prevent false-positive job failures, we'll skip | |
| # # the unit tests if no devices are found, but mark the unit test step as cancelled. The job is still marked as | |
| # # passed (green), but the Unit Tests step will show cancelled. This is the best we can do, as there appears to | |
| # # be no way to "cancel" an individual job programmatically. | |
| # continue-on-error: true | |
| # shell: bash | |
| # run: | | |
| # xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" > destinations.txt | |
| # SIMPLATFORM="iOS" | |
| # SIMDEVICE="iPhone\s\d{2}\s" | |
| # REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g" | |
| # SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }') | |
| # if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Available $SIMPLATFORM simulators:" | |
| # echo "$SIMPATFORMLIST" | |
| # DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1) | |
| # if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Using device name \"$DESTNAME\"" | |
| # echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV" | |
| # - name: Unit Tests | |
| # if: steps.destnameprep.outcome != 'failure' | |
| # run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=iOS Simulator,name=$DESTNAME" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| tvOS: | |
| name: tvOS | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Bootstrap Platforms | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcrun simctl list | |
| - name: Download Platform | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcodebuild -downloadPlatform tvOS | |
| - name: Build | |
| run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=tvOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| # skip unit tests - swift macro testing seems to be broken in Xcode 26.0 without an obvious workaround | |
| # - name: Prepare Destination Device Name | |
| # id: destnameprep | |
| # # As of GitHub's updates to the macOS-15 runner summer 2025, randomly Xcode may not list any simulators. | |
| # # No idea why. Seems like a bug or runner config issue. So to prevent false-positive job failures, we'll skip | |
| # # the unit tests if no devices are found, but mark the unit test step as cancelled. The job is still marked as | |
| # # passed (green), but the Unit Tests step will show cancelled. This is the best we can do, as there appears to | |
| # # be no way to "cancel" an individual job programmatically. | |
| # continue-on-error: true | |
| # shell: bash | |
| # run: | | |
| # xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" > destinations.txt | |
| # SIMPLATFORM="tvOS" | |
| # SIMDEVICE="Apple\sTV" | |
| # REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g" | |
| # SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }') | |
| # if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Available $SIMPLATFORM simulators:" | |
| # echo "$SIMPATFORMLIST" | |
| # DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1) | |
| # if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Using device name \"$DESTNAME\"" | |
| # echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV" | |
| # - name: Unit Tests | |
| # if: steps.destnameprep.outcome != 'failure' | |
| # run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=tvOS Simulator,name=$DESTNAME" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| watchOS: | |
| name: watchOS | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Bootstrap Platforms | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcrun simctl list | |
| - name: Download Platform | |
| # Workaround for Xcode/GitHub runner issues finding simulators. | |
| # see https://github.com/actions/runner-images/issues/12758#issuecomment-3206748945 | |
| run: xcodebuild -downloadPlatform watchOS | |
| - name: Build | |
| run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=watchOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| # skip unit tests - swift macro testing seems to be broken in Xcode 26.0 without an obvious workaround | |
| # - name: Prepare Destination Device Name | |
| # id: destnameprep | |
| # # As of GitHub's updates to the macOS-15 runner summer 2025, randomly Xcode may not list any simulators. | |
| # # No idea why. Seems like a bug or runner config issue. So to prevent false-positive job failures, we'll skip | |
| # # the unit tests if no devices are found, but mark the unit test step as cancelled. The job is still marked as | |
| # # passed (green), but the Unit Tests step will show cancelled. This is the best we can do, as there appears to | |
| # # be no way to "cancel" an individual job programmatically. | |
| # continue-on-error: true | |
| # shell: bash | |
| # run: | | |
| # xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" > destinations.txt | |
| # SIMPLATFORM="watchOS" | |
| # SIMDEVICE="Apple\sWatch\sSeries" | |
| # REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g" | |
| # SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }') | |
| # if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Available $SIMPLATFORM simulators:" | |
| # echo "$SIMPATFORMLIST" | |
| # DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1) | |
| # if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi | |
| # echo "Using device name \"$DESTNAME\"" | |
| # echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV" | |
| # - name: Unit Tests | |
| # if: steps.destnameprep.outcome != 'failure' | |
| # run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=watchOS Simulator,name=$DESTNAME" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} |