Skip to content

GitHub action that converts code coverage files from xcodebuild or swift test runs for processing with e.g. codecov.

License

Notifications You must be signed in to change notification settings

sersoft-gmbh/swift-coverage-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Swift Coverage Conversion

Tests

This action converts code coverage files from swift test or xcodebuild runs for processing with e.g. codecov. Note that this action does not run any test. Use swift test, xcodebuild or xcodebuild-action for that.

Inputs

search-paths

A list of search paths (one per line) that should be used for searching coverage data.
Default:

./.build
$HOME/Library/Developer/Xcode/DerivedData

output

The path to the output folder. Note that this folder will be deleted / overwritten by this action. You should probably put it in .gitignore.
Default: ./.swiftcov

format

The format to write the coverage files in. Can be 'lcov' or 'txt'.
Default: lcov

target-name-filter

A regular expression that is used to filter coverage files by their target names.

ignore-conversion-failures

If true, conversion failures are ignored. If fail-on-empty-output is also set to true, the action might still fail if all conversions fail.
Default: 'false'

fail-on-empty-output

If true, the action fails if no coverage files were found (output is still set to an empty array).
Default: 'false'

Outputs

files

The JSON encoded array of (absolute) file paths that were written. They are all contained inside the directory specified in the output input.

Example Usage

Use the following snippet after running tests with Swift or Xcode to convert those coverage files:

uses: sersoft-gmbh/swift-coverage-action@v4

Codecov Action (v2 or later)

To use this action together with codecov/codecov-action, you need to convert the output to a comma separated string:

- uses: sersoft-gmbh/swift-coverage-action@v4
  id: coverage-files
- uses: codecov/codecov-action@v3
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}

About

GitHub action that converts code coverage files from xcodebuild or swift test runs for processing with e.g. codecov.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •