Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,40 @@ jobs:
- name: Build
run: swift build --build-tests

- name: Test
run: swift test --skip-build
- 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@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify codecov-action SHA matches v6.0.1 tag

# Fetch the commit SHA for the v6.0.1 tag
tag_sha=$(gh api repos/codecov/codecov-action/git/ref/tags/v6.0.1 --jq '.object.sha')
echo "v6.0.1 tag SHA: $tag_sha"

# Compare with the pinned SHA in the workflow
pinned_sha="e79a6962e0d4c0c17b229090214935d2e33f8354"
echo "Pinned SHA: $pinned_sha"

if [[ "$tag_sha" == "$pinned_sha" ]]; then
  echo "✓ SHA matches v6.0.1"
else
  echo "✗ SHA mismatch - please update to the correct SHA for v6.0.1"
fi

Repository: agentruntimecontrolprotocol/swift-sdk

Length of output: 252


Fix Codecov action SHA/version mismatch

In .github/workflows/test.yml (line 109), codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 is incorrect: the v6.0.1 tag resolves to cddd853df119a48c5be31a973f8cd97e12e35e16. Update the pinned SHA and/or the inline version comment to match.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml at line 109, The workflow pins the Codecov action
to a SHA that doesn't match the inline version comment; update the `uses:
codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354` entry so the
SHA and the `# v6.0.1` comment are consistent: either replace the SHA with the
commit that `v6.0.1` resolves to (cddd853df119a48c5be31a973f8cd97e12e35e16) or
change the inline version comment to the tag/SHA you're actually pinning,
ensuring the `uses:` value and the `#` comment match.

with:
fail_ci_if_error: false
flags: unittests
files: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test artifacts on failure
if: failure()
Expand Down
Loading