Add missing platform availability annotations to coding key types #1041
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: JBird CI | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "*release*" | |
| pull_request: | |
| branches: | |
| - "main" | |
| - "*release*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-ios-xcode: | |
| name: Build JBird (iOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "18.6", "17.7", "16.6"] | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select 26.2 | |
| - name: Build JBird for iOS ${{ matrix.version }} | |
| run: ./.scripts/build-ios-xcode JBird ${{ matrix.version }} | |
| build-tvos-xcode: | |
| name: Build JBird (tvOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "18.6", "17.7", "16.6"] | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select 26.2 | |
| - name: Build JBird for tvOS ${{ matrix.version }} | |
| run: ./.scripts/build-tvos-xcode JBird ${{ matrix.version }} | |
| build-watchos-xcode: | |
| name: Build JBird (watchOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "11.6", "10.7", "9.6"] | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select 26.2 | |
| - name: Build JBird for watchOS ${{ matrix.version }} | |
| run: ./.scripts/build-watchos-xcode JBird ${{ matrix.version }} | |
| build-macos-xcode: | |
| name: Build JBird (macOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "15.5"] | |
| include: | |
| - version: "26.2" | |
| runner: macos-26 | |
| xcode: "26.2" | |
| - version: "15.5" | |
| runner: macos-15 | |
| xcode: "16.4" | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select ${{ matrix.xcode }} | |
| - name: List SDKs | |
| run: xcodebuild -showsdks | grep macosx | |
| - name: Build JBird for macOS ${{ matrix.version }} | |
| run: ./.scripts/build-macos-xcode JBird ${{ matrix.version }} | |
| build-maccatalyst-xcode: | |
| name: Build JBird (Mac Catalyst) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "15.5"] | |
| include: | |
| - version: "26.2" | |
| runner: macos-26 | |
| xcode: "26.2" | |
| - version: "15.5" | |
| runner: macos-15 | |
| xcode: "16.4" | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select ${{ matrix.xcode }} | |
| - name: List SDKs | |
| run: xcodebuild -showsdks | grep macosx | |
| - name: Build JBird for Mac Catalyst ${{ matrix.version }} | |
| run: ./.scripts/build-maccatalyst-xcode JBird ${{ matrix.version }} | |
| build-visionos-xcode: | |
| name: Build JBird (visionOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["26.2", "2.6", "1.7"] | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select 26.2 | |
| - name: Build JBird for visionOS ${{ matrix.version }} | |
| run: ./.scripts/build-visionos-xcode JBird ${{ matrix.version }} | |
| swiftformat: | |
| name: Run SwiftFormat | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select | |
| - name: Lint with SwiftFormat | |
| run: ./.scripts/lint-swiftformat | |
| build-macos-spm: | |
| name: Build JBird (macOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| include: | |
| - swift: "6.1" | |
| runner: "macos-15" | |
| xcode: "16.4" | |
| - swift: "6.2" | |
| runner: "macos-26" | |
| xcode: "26.4" | |
| - swift: "6.3" | |
| runner: "macos-26" | |
| xcode: "26.4" | |
| runs-on: ${{ matrix.runner }} | |
| outputs: | |
| artifact-name: macos-build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select ${{ matrix.xcode }} | |
| - name: Build JBird | |
| run: swift build -v --build-tests --build-path .build | |
| - name: Compress Build | |
| run: zip -r build.zip .build | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: macos-build-${{ matrix.swift }} | |
| path: build.zip | |
| test-macos-spm: | |
| name: Test JBird (macOS) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| include: | |
| - swift: "6.1" | |
| runner: "macos-15" | |
| xcode: "16.4" | |
| - swift: "6.2" | |
| runner: "macos-26" | |
| xcode: "26.4" | |
| - swift: "6.3" | |
| runner: "macos-26" | |
| xcode: "26.4" | |
| needs: build-macos-spm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Xcode Version | |
| run: ./.scripts/xcode-select ${{ matrix.xcode }} | |
| - name: Download Build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: macos-build-${{ matrix.swift }} | |
| path: . | |
| - name: Decompress Build | |
| run: unzip build.zip | |
| - name: Test JBird | |
| run: swift test --skip-build | |
| build-ubuntu-spm: | |
| name: Build JBird (Ubuntu) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| artifact-name: ubuntu-build | |
| container: | |
| image: swift:${{ matrix.swift }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build JBird | |
| run: swift build -v --build-tests --build-path .build | |
| - name: Install `zip` | |
| run: apt-get update && apt-get install -y zip | |
| - name: Compress Build | |
| run: zip -r build.zip .build | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ubuntu-build-${{ matrix.swift }} | |
| path: build.zip | |
| test-ubuntu-spm: | |
| name: Test JBird (Ubuntu) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| needs: build-ubuntu-spm | |
| runs-on: ubuntu-latest | |
| container: | |
| image: swift:${{ matrix.swift }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download Build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ubuntu-build-${{ matrix.swift }} | |
| path: . | |
| - name: Install `unzip` | |
| run: apt-get update && apt-get install -y unzip | |
| - name: Decompress Build | |
| run: unzip build.zip | |
| - name: Test JBird | |
| run: swift test --skip-build | |
| build-windows-spm: | |
| name: Build JBird (Windows) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Swift | |
| uses: compnerd/gha-setup-swift@main | |
| with: | |
| swift-version: swift-${{ matrix.swift }}-release | |
| swift-build: ${{ matrix.swift }}-RELEASE | |
| - name: Build JBird | |
| run: swift build -v --build-tests --disable-xctest --build-path .build -c debug -Xlinker /INCREMENTAL:NO | |
| - name: Compress Build | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path ".build" -DestinationPath "build.zip" -Force | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows-build-${{ matrix.swift }} | |
| path: build.zip | |
| test-windows-spm: | |
| name: Test JBird (Windows) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| needs: build-windows-spm | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Swift | |
| uses: compnerd/gha-setup-swift@main | |
| with: | |
| swift-version: swift-${{ matrix.swift }}-release | |
| swift-build: ${{ matrix.swift }}-RELEASE | |
| - name: Download Build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: windows-build-${{ matrix.swift }} | |
| path: . | |
| - name: Decompress Build | |
| shell: pwsh | |
| run: | | |
| Expand-Archive -Path "build.zip" -DestinationPath "." -Force | |
| - name: Test JBird | |
| run: swift test --disable-xctest --skip-build | |
| build-wasm-spm: | |
| name: Build JBird (WebAssembly) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| runs-on: ubuntu-latest | |
| container: | |
| image: swift:${{ matrix.swift }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - if: ${{ matrix.swift == '6.3' }} | |
| name: Setup Swift WASM (6.3) | |
| run: | | |
| swift sdk install https://download.swift.org/swift-6.3-release/wasm-sdk/swift-6.3-RELEASE/swift-6.3-RELEASE_wasm.artifactbundle.tar.gz \ | |
| --checksum 9fa4016ee632c7e9e906608ec3b55cf13dfc4dff44e47574c5af58064dc33fd9 | |
| swift sdk list | |
| - if: ${{ matrix.swift == '6.2' }} | |
| name: Setup Swift WASM (6.2) | |
| run: | | |
| swift sdk install https://download.swift.org/swift-6.2.3-release/wasm-sdk/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE_wasm.artifactbundle.tar.gz \ | |
| --checksum 394040ecd5260e68bb02f6c20aeede733b9b90702c2204e178f3e42413edad2a | |
| swift sdk list | |
| - if: ${{ matrix.swift == '6.1' }} | |
| name: Setup Swift WASM | |
| id: swiftwasm | |
| uses: swiftwasm/setup-swiftwasm@v2 | |
| with: | |
| tag: swift-${{ matrix.swift }}-RELEASE | |
| - if: ${{ matrix.swift == '6.3' }} | |
| name: Build JBird (6.3) | |
| run: swift build -v --swift-sdk swift-6.3-RELEASE_wasm --build-path .build | |
| - if: ${{ matrix.swift == '6.2' }} | |
| name: Build JBird (6.2) | |
| run: swift build -v --swift-sdk swift-6.2.3-RELEASE_wasm --build-path .build | |
| - if: ${{ matrix.swift == '6.1' }} | |
| name: Build JBird | |
| run: swift build -v --swift-sdk ${{ steps.swiftwasm.outputs.swift-sdk-id }} --build-path .build | |
| - name: Install `zip` | |
| run: apt-get update && apt-get install -y zip | |
| - name: Compress Build | |
| run: zip -r build.zip .build | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wasm-build-${{ matrix.swift }} | |
| path: build.zip | |
| build-android-spm: | |
| name: Build JBird (Android) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift: ["6.1", "6.2", "6.3"] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| artifact-name: android-build-${{ matrix.swift }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build JBird | |
| uses: skiptools/swift-android-action@v2 | |
| with: | |
| swift-version: ${{ matrix.swift }} | |
| build-package: true | |
| build-tests: false | |
| run-tests: false | |
| - name: Install `zip` | |
| run: sudo apt-get update && sudo apt-get install -y zip | |
| - name: Compress Build | |
| run: zip -r build.zip .build | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-build-${{ matrix.swift }} | |
| path: build.zip | |
| clang-format: | |
| name: Run clang-format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install clang-format | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-format | |
| - name: Validate formatting | |
| run: ./.scripts/lint-clang-format | |
| lint-docc: | |
| name: Validate Documentation | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select | |
| - name: Validate Documentation | |
| run: ./.scripts/lint-docc | |
| build-xcframework: | |
| name: Build XCFrameworks | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [JBird, JBirdCore, JBirdBuilders, JBirdCodableSupport] | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select 26.2 | |
| - name: Build XCFramework | |
| run: ./.scripts/build-xcframework ${{ matrix.target }} | |
| coverage: | |
| name: Measure Test Coverage | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select | |
| - name: Run llvm-cov | |
| env: | |
| FAIL_ON_THRESHOLD: "true" | |
| COVERAGE_THRESHOLD: "80" | |
| REPORT_DIR: "coverage" | |
| run: .scripts/coverage | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-${{ github.sha }} | |
| path: | | |
| coverage/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload to codecov.io | |
| if: ${{ always() }} | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| files: coverage/coverage.lcov | |
| flags: swiftpm,llvm-cov | |
| name: ${{ github.workflow }}-${{ github.run_id }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| static-analyzer: | |
| name: Run Static Analyzer | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode Version | |
| run: ./.scripts/xcode-select | |
| - name: Analyze C parsing core | |
| env: | |
| DERIVED_DATA: ${{ runner.temp }}/analyzer-derived-data | |
| run: | | |
| set -eo pipefail | |
| rm -rf "$DERIVED_DATA" | |
| xcodebuild \ | |
| -project JBird.xcodeproj \ | |
| -scheme JBirdParser \ | |
| -configuration Debug \ | |
| -destination 'platform=macOS' \ | |
| -derivedDataPath "$DERIVED_DATA" \ | |
| clean analyze | |
| rm -rf "$DERIVED_DATA" | |
| validate-pr: | |
| name: Validate Pull Request | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| needs: | |
| - build-ios-xcode | |
| - build-tvos-xcode | |
| - build-watchos-xcode | |
| - build-macos-xcode | |
| - build-visionos-xcode | |
| - build-macos-spm | |
| - test-macos-spm | |
| - build-ubuntu-spm | |
| - test-ubuntu-spm | |
| - build-windows-spm | |
| - test-windows-spm | |
| - build-wasm-spm | |
| - build-android-spm | |
| - build-xcframework | |
| - swiftformat | |
| - clang-format | |
| - lint-docc | |
| - coverage | |
| - static-analyzer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check upstream jobs | |
| run: | | |
| if [[ "${{ needs.build-ios-xcode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-tvos-xcode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-watchos-xcode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-macos-xcode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-visionos-xcode.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-macos-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-macos-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-ubuntu-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-ubuntu-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-windows-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test-windows-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-wasm-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-android-spm.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.build-xcframework.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.swiftformat.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.clang-format.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.lint-docc.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.coverage.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.static-analyzer.result }}" == "failure" ]]; then | |
| echo "❌ Required job failed." | |
| exit 1 | |
| else | |
| echo "✅ All required jobs completed successfully." | |
| fi |