-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (49 loc) · 1.65 KB
/
create-and-upload-coverage-report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# This source file is part of the Stanford Biodesign Digital Health Group open-source organization
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#
name: Create and upload coverage report
on:
workflow_call:
inputs:
coveragereports:
description: 'A string containing all names of the .xcresult files that are downloaded from the artifacts of previous jobs separated by a space character.'
required: true
type: string
secrets:
token:
description: 'The CodeCov token used for private repositories'
required: false
jobs:
create-and-upload-coverage-report:
name: Create and upload coverage report
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check environment
run: |
xcodebuild -version
swift --version
- uses: actions/download-artifact@v4
- name: Rename single code coverage report
if: "!contains(inputs.coveragereports, ' ')"
run: |
mv ${{ inputs.coveragereports }} CodeCoverage.xcresult
- name: Merge coverage reports
if: "contains(inputs.coveragereports, ' ')"
run: |
xcrun xcresulttool merge ${{ inputs.coveragereports }} --output-path CodeCoverage.xcresult
rm -rf ${{ inputs.coveragereports }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.token }}
xcode: true
xcode_archive_path: CodeCoverage.xcresult