Skip to content

Commit

Permalink
Convert coverage format before Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
withinfocus committed Jun 5, 2024
1 parent 141b6b7 commit 2edaf9b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ env:
MINT_LINK_PATH: .mint/bin
MINT_PATH: .mint/lib
SIMULATOR_DESTINATION: platform=iOS Simulator,name=iPhone 15 Pro,OS=17.0.1
RESULT_BUNDLE_PATH: build/AuthenticatorTests.xcresult
COVERAGE_PATH: build/coverage.xml

jobs:
check-run:
Expand Down Expand Up @@ -59,9 +61,9 @@ jobs:
sudo installer -pkg yeetd-normal.pkg -target /
yeetd &
- name: Install Mint, protobuf, xcbeautify, and yq
- name: Install Mint, protobuf, xcbeautify, and xcresultparser
run: |
brew install mint swift-protobuf xcbeautify
brew install mint swift-protobuf xcbeautify a7ex/homebrew-formulae/xcresultparser
./Scripts/bootstrap.sh
- name: Build and test
Expand All @@ -72,12 +74,21 @@ jobs:
-scheme Authenticator \
-configuration Debug \
-destination "${{ env.SIMULATOR_DESTINATION }}" \
-resultBundlePath build/AuthenticatorTests.xcresult \
-resultBundlePath ${{ env.RESULT_BUNDLE_PATH }} \
-derivedDataPath build/DerivedData \
-enableCodeCoverage YES \
| xcbeautify --renderer github-actions
- name: Convert coverage to Cobertura
run: |
set -o pipefail && \
xcresultparser --output-format cobertura \
"$RESULT_BUNDLE_PATH" >"$COVERAGE_PATH"
- name: Upload to codecov.io
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
with:
plugin: xcode
file: ${{ env.COVERAGE_PATH }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 2edaf9b

Please sign in to comment.