chore(deps): bump codecov/codecov-action from 6.0.1 to 7.0.0 (#89) #41
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
| # CI for swift-sdk (ARCP). | |
| # | |
| # Action pinning policy: | |
| # - First-party actions (actions/*) are pinned to a major version tag. | |
| # - Third-party actions are pinned to a full commit SHA with a version comment. | |
| # | |
| # Platforms: macOS only (Package.swift declares .macOS(.v14); no Linux platform). | |
| # Swift matrix: 6.1 — floor declared by `// swift-tools-version: 6.1`. The full | |
| # ecosystem (swift-nio, swift-log, swift-certificates, swift-crypto) now | |
| # requires 6.1+, so the previous 6.0 entry no longer resolves. | |
| name: test | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - ".editorconfig" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "docs/**" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - ".editorconfig" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: swift ${{ matrix.swift }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest] | |
| swift: ["6.1"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Swift ${{ matrix.swift }} | |
| # SwiftyLab/setup-swift v1.14.0 | |
| uses: SwiftyLab/setup-swift@38f54a76b70d989321de9dc7c840618c08cf56e9 | |
| with: | |
| swift-version: ${{ matrix.swift }} | |
| - name: Print Swift version | |
| run: swift --version | |
| - name: Cache .build | |
| uses: actions/cache@v5 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift-${{ matrix.swift }}-spm- | |
| - name: Resolve dependencies | |
| run: swift package resolve | |
| - name: Lint (swift-format) | |
| run: swift run swift-format lint --recursive --strict Sources Tests | |
| - name: Build | |
| run: swift build --build-tests --enable-code-coverage | |
| - name: Test (with code coverage) | |
| run: swift test --skip-build --enable-code-coverage | |
| # swift test --enable-code-coverage produces a profdata file under | |
| # .build/<arch>/debug/codecov/. Export to lcov via llvm-cov so | |
| # Codecov can parse it. Non-blocking so a Codecov outage cannot | |
| # break CI. | |
| - name: Export coverage (lcov) | |
| run: | | |
| binary=$(swift build --show-bin-path) | |
| profdata="$binary/codecov/default.profdata" | |
| xctest=$(find "$binary" -maxdepth 3 -name "*.xctest" -print -quit) | |
| # SwiftPM packages tests inside a .xctest bundle. On macOS the | |
| # executable lives at <bundle>/Contents/MacOS/<name>. | |
| if [[ -d "$xctest/Contents/MacOS" ]]; then | |
| exe=$(find "$xctest/Contents/MacOS" -type f -perm -u+x -print -quit) | |
| else | |
| exe="$xctest" | |
| fi | |
| xcrun llvm-cov export "$exe" \ | |
| -instr-profile="$profdata" \ | |
| -format=lcov \ | |
| -ignore-filename-regex='(\.build|Tests)/' \ | |
| > coverage.lcov | |
| shell: bash | |
| - name: Upload coverage to Codecov | |
| # codecov/codecov-action v6.0.1 | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| fail_ci_if_error: false | |
| flags: unittests | |
| files: ./coverage.lcov | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-artifacts-swift-${{ matrix.swift }}-${{ matrix.os }} | |
| path: | | |
| .build/**/*.xctest | |
| .build/**/*.log | |
| .build/debug/codecov/** | |
| if-no-files-found: ignore | |
| retention-days: 7 |