Repository navigation
ci: update runners, Xcode versions and actions (#9) #32
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: "blade" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| paths: | |
| - '.swiftlint.yml' | |
| - ".github/workflows/**" | |
| - "Package*.swift" | |
| - "Sources/**" | |
| - "Tests/**" | |
| jobs: | |
| SwiftLint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: GitHub Action for SwiftLint | |
| uses: norio-nomura/action-swiftlint@3.2.1 | |
| with: | |
| args: --strict | |
| env: | |
| DIFF_BASE: ${{ github.base_ref }} | |
| macOS: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runsOn }} | |
| env: | |
| DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - xcode: "Xcode_16.4" | |
| runsOn: macos-15 | |
| name: "macOS 15, Xcode 16.4, Swift 6.1" | |
| params: "-skipMacroValidation" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: ${{ matrix.name }} | |
| run: xcodebuild test -scheme "Blade-Package" -destination "platform=macOS" clean -enableCodeCoverage YES ${{ matrix.params }} -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4.5.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| xcode: true | |
| xcode_archive_path: test_output/${{ matrix.name }}.xcresult | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: test_output | |
| iOS: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runsOn }} | |
| env: | |
| DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - destination: "platform=iOS Simulator,name=iPhone 16 Pro" | |
| name: "iOS 18" | |
| xcode: "Xcode_16.4" | |
| runsOn: macos-15 | |
| params: "-skipMacroValidation" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: ${{ matrix.name }} | |
| run: xcodebuild test -scheme "Blade-Package" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES ${{ matrix.params }} -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: test_output | |
| tvOS: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runsOn }} | |
| env: | |
| DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - destination: "platform=tvOS Simulator,name=Apple TV" | |
| name: "tvOS 18" | |
| xcode: "Xcode_16.4" | |
| runsOn: macos-15 | |
| params: "-skipMacroValidation" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: ${{ matrix.name }} | |
| run: xcodebuild test -scheme "Blade-Package" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES ${{ matrix.params }} -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4.5.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| xcode: true | |
| xcode_archive_path: test_output/${{ matrix.name }}.xcresult | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: test_output | |
| watchOS: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runsOn }} | |
| env: | |
| DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - destination: "platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)" | |
| name: "watchOS 11" | |
| xcode: "Xcode_16.4" | |
| runsOn: macos-15 | |
| params: "-skipMacroValidation" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: ${{ matrix.name }} | |
| run: xcodebuild test -scheme "Blade-Package" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES ${{ matrix.params }} -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4.5.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| xcode: true | |
| xcode_archive_path: test_output/${{ matrix.name }}.xcresult | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: test_output | |
| spm: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.runsOn }} | |
| env: | |
| DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Xcode 16" | |
| xcode: "Xcode_16.4" | |
| runsOn: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Toolchain versions | |
| run: | | |
| swift --version | |
| xcodebuild -version | |
| - name: ${{ matrix.name }} | |
| run: | | |
| swift build --target "Blade" | |
| swift build --target "BladeTCA" | |
| merge-test-reports: | |
| needs: [iOS, macOS, watchOS, tvOS] | |
| runs-on: macos-15 | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test_output | |
| - run: xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/final/final.xcresult | |
| - name: Upload Merged Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MergedResult | |
| path: test_output/final | |
| discover-typos: | |
| name: Discover Typos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Discover typos | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install codespell | |
| codespell --ignore-words-list="hart,inout,msdos,sur" --skip="./.build/*,./.git/*" |