Introduction
I have written a Swift Package and would like to integrate Codecov as a part of my CI (set up with Github Actions).
Here is my .yml
file:
name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v --enable-code-coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v3.1.0
The Problem
The problem is that Codecov doesn't work with the report files generated by xcodebuild
or swift
commands. Here is the doc.
Possible Solution
Codecov suggests using other third-party tools, such as Slather, to convert the reported files into expected formats (.xml
, .json
, etc.), but Slather is not compatible with Swift Packages (works only with .xcodeproj
or .xcworkspace
projects).
Could you please help here or suggest alternative approaches? Thanks.