-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hello folks! I love your work. I'm trying to collect Swift code coverage data from tests running on the Android emulator specifically for https://about.codecov.io but there's currently no built-in way to retrieve the generated .profraw files from the device back to the CI host.
Use Case
When running Swift tests with code coverage instrumentation on Android:
- Tests are built with coverage flags:
-Xswiftc -profile-coverage-mapping -Xswiftc -profile-generate - Tests run on the Android emulator via this action
- Coverage data (
.profrawfiles) are generated on the emulator - These files need to be retrieved to process with
llvm-profdataand upload to codecov
Current Limitation
The copy-files parameter only supports copying files to the emulator before tests run, not retrieving files from the emulator after tests complete.
Proposed Solution
Add support for retrieving files from the emulator after tests complete. Possible implementations:
Option 1: New retrieve-files parameter
- uses: skiptools/swift-android-action@v2
with:
retrieve-files: |
/data/local/tmp/android-xctest/*.profraw
retrieve-to: .build/coverageOption 2: Automatic coverage retrieval
Add a collect-coverage boolean parameter that:
- Automatically pulls
.profrawfiles from the test directory - Places them in
.build/for standard Swift coverage tools to find
You can look at my attempts here:
https://github.com/brightdigit/MistKit/blob/feature/android-ci/.github/workflows/MistKit.yml
Would be happy to test any implementation or provide additional details!