Skip to content

Commit eb9c0cc

Browse files
authored
chore: Using codecov bash to upload results (#3153)
1 parent 941ea90 commit eb9c0cc

File tree

4 files changed

+1768
-21
lines changed

4 files changed

+1768
-21
lines changed

.github/composite_actions/run_xcodebuild_test/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ runs:
4747
coverageFlags=""
4848
if [ "${{ inputs.generate_coverage }}" == "true" ]; then
4949
echo "Code Coverage is enabled!"
50-
coverageFlags+="-derivedDataPath Build/ -clonedSourcePackagesDirPath "~/Library/Developer/Xcode/DerivedData/$SCHEME" -enableCodeCoverage YES build test"
50+
coverageFlags+="-derivedDataPath Build/ -clonedSourcePackagesDirPath "~/Library/Developer/Xcode/DerivedData/$SCHEME" -enableCodeCoverage YES"
5151
fi
5252
xcode-select -p
5353
xcodebuild -version
@@ -62,5 +62,5 @@ runs:
6262
cd $(ls -d */|head -n 1)
6363
pathCoverage=Build/Build/ProfileData/${PWD##*/}/Coverage.profdata
6464
cd ../../../../
65-
xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug-iphonesimulator/$SCHEME.o > Coverage.lcov
65+
xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug-${{ inputs.sdk }}/$SCHEME.o > Coverage.lcov
6666
shell: bash

.github/workflows/run_xcodebuild_test_platforms.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_call:
44
inputs:
55
scheme:
6-
description: 'The scheme to run the unit tests'
6+
description: 'The scheme to run the tests'
77
required: true
88
type: string
99
timeout-minutes:
@@ -20,7 +20,7 @@ on:
2020
description: 'What flag to include in the coverage report, separated by commas'
2121
required: false
2222
type: string
23-
default: 'unittests'
23+
default: 'tests'
2424

2525
env:
2626
SCHEME: ${{ inputs.scheme }}
@@ -46,9 +46,9 @@ jobs:
4646
generate_coverage: ${{ inputs.submit_coverage_report }}
4747
- name: Upload Coverage report to Codecov
4848
if: ${{ inputs.submit_coverage_report == true }}
49-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
50-
with:
51-
flags: ${{ inputs.coverage_flags }}
49+
shell: bash
50+
run: |
51+
build-support/codecov.sh -F '${{ inputs.coverage_flags }}'
5252
5353
test-macOS:
5454
name: ${{ inputs.scheme }} macOS Tests

.github/workflows/unit_test.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,26 @@ jobs:
2929
submit_coverage_report: false
3030

3131
unit-tests-with-coverage:
32-
name: ${{ matrix.scheme }} Unit Tests
32+
name: ${{ matrix.scheme.name }} Unit Tests
3333
strategy:
3434
fail-fast: false
3535
matrix:
3636
scheme: [
37-
Amplify,
38-
AWSPluginsCore,
39-
AWSAPIPlugin,
40-
AWSCloudWatchLoggingPlugin,
41-
AWSCognitoAuthPlugin,
42-
AWSDataStorePlugin,
43-
AWSLocationGeoPlugin,
44-
AWSPredictionsPlugin,
45-
AWSPinpointAnalyticsPlugin,
46-
AWSPinpointPushNotificationsPlugin,
47-
AWSS3StoragePlugin,
48-
CoreMLPredictionsPlugin
37+
{ name: Amplify, flags: 'Amplify,unit_tests' },
38+
{ name: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' },
39+
{ name: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' },
40+
{ name: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
41+
{ name: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
42+
{ name: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
43+
{ name: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
44+
{ name: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
45+
{ name: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
46+
{ name: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
47+
{ name: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
48+
{ name: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
4949
]
5050
uses: ./.github/workflows/run_xcodebuild_test_platforms.yml
5151
with:
52-
scheme: ${{ matrix.scheme }}
52+
scheme: ${{ matrix.scheme.name }}
5353
submit_coverage_report: true
54+
coverage_flags: ${{ matrix.scheme.flags }}

0 commit comments

Comments
 (0)