Repository navigation
Fully support Swift 6 and drop Swift 5 compatibility #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2a8242c
add Package.swift for Swift 6
417-72KI d43085c
replace swift tools version to 6.x
417-72KI a669f29
update Dangerfile
417-72KI 1d56976
update CI releated files
417-72KI 22852c3
fix type-check failure
417-72KI 58f7b0b
convert to Swift Testing
417-72KI 9cd36f5
fix lint warnings
417-72KI 3d67460
enable remaining flags
417-72KI edd3d3d
enable swift 6 mode
417-72KI 54f1f75
remove unnecessary flag
417-72KI 3acec3a
fix: `error while loading shared libraries: libxml2.so.2: cannot open…
417-72KI c0d6e20
fix workflow
417-72KI 9353fb2
apply suggestion
417-72KI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @417-72KI |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| while getopts "f:" opt; do | ||
| case "$opt" in | ||
| f) FILE="$OPTARG" ;; | ||
| \?) exit 1 ;; | ||
| esac | ||
| done | ||
| shift $((OPTIND - 1)) | ||
|
|
||
| matrix_file="${FILE:-$(git rev-parse --show-toplevel)/.github/matrix.yml}" | ||
| mode=$(echo "${1:-macOS}" | tr 'A-Z' 'a-z') | ||
|
|
||
| if [ "$mode" = "macos" ]; then | ||
| yq -o=json -I=0 '[ | ||
| .macos_runners | ||
| | to_entries[] as $runner | ||
| | $runner.value.xcode | ||
| | to_entries[] as $xcode | ||
| | $xcode.value.destination[] | ||
| | { | ||
| "runner": $runner.key, | ||
| "xcode": $xcode.key, | ||
| "destination": . | ||
| } | ||
| ]' "$matrix_file" | ||
| elif [ "$mode" = "linux" ]; then | ||
| yq -o=json -I=0 '.linux_runner.swift_versions' "$matrix_file" | ||
| else | ||
| echo "Unsupported mode: $mode" >&2 | ||
| exit 1 | ||
| fi |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| macos_runners: | ||
| xcode-27: # ref: https://github.com/actions/runner-images/blob/main/images/macos/xcode-27-arm64-Readme.md | ||
| xcode: | ||
| "27.0": # Swift 6.4 | ||
| destination: | ||
| - platform=macOS | ||
| - platform=iOS Simulator,name=iPhone 18 Pro | ||
| - platform=tvOS Simulator,name=Apple TV 4K (3rd generation) | ||
| macos-26: # ref: https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md | ||
| xcode: | ||
| "26.6": # Swift 6.3 | ||
| destination: | ||
| - platform=macOS | ||
| - platform=iOS Simulator,name=iPhone 17 Pro | ||
| - platform=tvOS Simulator,name=Apple TV 4K (3rd generation) | ||
| "26.3": # Swift 6.2 | ||
| destination: | ||
| - platform=macOS | ||
| - platform=iOS Simulator,name=iPhone 17 Pro | ||
| - platform=tvOS Simulator,name=Apple TV 4K (3rd generation) | ||
| macos-15: # ref: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md | ||
| xcode: | ||
| "16.4": # Swift 6.1 | ||
| destination: | ||
| - platform=macOS | ||
| - platform=iOS Simulator,name=iPhone 16 Pro | ||
| - platform=tvOS Simulator,name=Apple TV 4K (3rd generation) | ||
| linux_runner: | ||
| swift_versions: | ||
| - "6.4" | ||
| - "6.3" | ||
| - "6.2" | ||
| - "6.1" |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| name: Pull Request | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, edited] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: ${{ github.ref }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| extract-matrix: | ||
| name: Create matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| macos-versions: ${{ steps.extract-matrix.outputs.macos-versions }} | ||
| linux-swift-versions: ${{ steps.extract-matrix.outputs.linux-swift-versions }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| - id: extract-matrix | ||
| run: | | ||
| echo "macos-versions=$(.github/create-matrix.sh macOS)" >> $GITHUB_OUTPUT | ||
| echo "linux-swift-versions=$(.github/create-matrix.sh Linux)" >> $GITHUB_OUTPUT | ||
| test-macos: | ||
| name: Test(macOS) | ||
| needs: extract-matrix | ||
| strategy: | ||
| matrix: | ||
| include: ${{ fromJson(needs.extract-matrix.outputs.macos-versions) }} | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.runner }} | ||
| env: | ||
| DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| - id: create-destination-key | ||
| name: Create destination key for cache | ||
| run: echo "destination-key=$(echo "xcode_${{ matrix.xcode }}-${{ matrix.destination }}" | sed 's/[, ]/_/g')" >> $GITHUB_OUTPUT | ||
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | ||
| with: | ||
| path: | | ||
| .build/SourcePackages | ||
| key: ${{ runner.os }}-${{ matrix.xcode }}-${{ steps.create-destination-key.outputs.destination-key }}-${{ hashFiles('Package.swift') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.xcode }}-${{ steps.create-destination-key.outputs.destination-key }}- | ||
| ${{ runner.os }}-${{ matrix.xcode }}- | ||
| - name: Enable macro and plugin | ||
| run: | | ||
| defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | ||
| defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES | ||
| - name: List available simulators | ||
| run: | | ||
| xcrun simctl list | ||
| - name: Set up test package when repository is a template | ||
| if: ${{ github.event.repository.is_template }} | ||
| run: swift package init | ||
| - name: Preboot iPhone 18 Pro simulator # Ref: https://github.com/actions/runner-images/issues/12777 | ||
| if: ${{ startsWith(matrix.xcode, '27') && endsWith(matrix.destination, 'name=iPhone 18 Pro') }} | ||
| run: | | ||
| xcrun simctl boot "iPhone 18 Pro" || true | ||
| xcrun simctl bootstatus "iPhone 18 Pro" | ||
| - name: test | ||
| run: | | ||
| defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 | ||
| set -o pipefail && \ | ||
| xcrun xcodebuild \ | ||
| -enableCodeCoverage YES \ | ||
| -scheme "$(xcodebuild -list -json | jq -rc '.workspace.schemes[0] // .workspace.name')" \ | ||
| -destination "${{ matrix.destination }}" \ | ||
| -derivedDataPath '.build' \ | ||
| -resultBundlePath 'test_output/TestResult.xcresult' \ | ||
| clean test | xcbeautify | ||
| - name: Upload test result | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | ||
| if: success() || failure() | ||
| with: | ||
| name: ${{ steps.create-destination-key.outputs.destination-key }} | ||
| path: test_output | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
| merge-xcresult: | ||
| name: Merge xcresult | ||
| needs: test-macos | ||
| if: always() && !cancelled() | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 | ||
| with: | ||
| path: test_output | ||
| - name: Merge | ||
| run: | | ||
| xcrun xcresulttool merge --output-path 'TestResult.xcresult' test_output/**/TestResult.xcresult | ||
| xcrun xcresulttool get test-results tests --path 'TestResult.xcresult' > 'result.json' | ||
| - name: Upload test result | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | ||
| with: | ||
| name: merged-test-result | ||
| path: | | ||
| TestResult.xcresult | ||
| result.json | ||
| if-no-files-found: error | ||
| retention-days: 30 | ||
| test-linux: | ||
| name: Test(Linux) | ||
| needs: extract-matrix | ||
| runs-on: ubuntu-latest | ||
| container: swift:${{ matrix.swift }} | ||
| strategy: | ||
| matrix: | ||
| swift: ${{ fromJson(needs.extract-matrix.outputs.linux-swift-versions) }} | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | ||
| with: | ||
| path: | | ||
| .build/artifacts | ||
| .build/checkouts | ||
| .build/repositories | ||
| key: ${{ runner.os }}-${{ matrix.swift }}-${{ hashFiles('Package.swift') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ matrix.swift }}- | ||
| - name: Set up libxml if needed | ||
| run: | | ||
| # ref: https://discourse.ubuntu.com/t/psa-ubuntu-25-10-features-a-libxml2-version-with-api-breaking-changes/71783/2 | ||
| libxml2_paths=$(ldconfig -p | grep libxml2 | sed -E 's/(.*) => (.*)/\2/g') | ||
| if [ -z "$(echo "$libxml2_paths" | grep '.so.2')" ] && [ -n "$(echo "$libxml2_paths" | grep '.so.16')" ]; then | ||
| libxml2_16_path="$(echo "$libxml2_paths" | grep '.so.16')" | ||
| libxml2_2_path="$(echo "$libxml2_16_path" | sed 's/\.so\.16/\.so\.2/')" | ||
| ln -s "$libxml2_16_path" "$libxml2_2_path" | ||
| fi | ||
| - name: Set up test package when repository is a template | ||
| if: ${{ github.event.repository.is_template }} | ||
| run: swift package init | ||
| - name: test | ||
| run: swift test | ||
| danger: | ||
| name: Danger | ||
| needs: merge-xcresult | ||
| if: ${{ always() && !cancelled() }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| checks: write | ||
| pull-requests: write | ||
| issues: write | ||
| statuses: write | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 | ||
| continue-on-error: true | ||
| with: | ||
| name: merged-test-result | ||
| path: test_output | ||
| - name: Run Danger | ||
| uses: 417-72KI/danger-swiftlint@e0eee1ddb70909a05eb326714b269d7499d28ab8 # v6.4 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.