Skip to content

Commit

Permalink
Write a script for merging test results from various platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-vasilev committed Dec 31, 2023
1 parent 0154406 commit 60a60bb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
49 changes: 29 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ jobs:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Flare" -destination "platform=macOS" clean -enableCodeCoverage YES -resultBundlePath "./macos.xcresult" || exit 1
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
- uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./macos.xcresult"
name: macos-coverage
path: ./macos.xcresult

iOS:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -83,12 +81,10 @@ jobs:
run: make generate
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Flare" -destination "${{ matrix.destination }}" -testPlan AllTests clean -enableCodeCoverage YES -resultBundlePath "./iphonesimulator.xcresult" || exit 1
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
- uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./iphonesimulator.xcresult"
name: ios-coverage
path: ./iphonesimulator.xcresult

tvOS:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -116,12 +112,10 @@ jobs:
run: make generate
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Flare" -destination "${{ matrix.destination }}" -testPlan AllTests clean -enableCodeCoverage YES -resultBundlePath "./appletvsimulator.xcresult" || exit 1
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
- uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./appletvsimulator.xcresult"
name: tvos-coverage
path: ./appletvsimulator.xcresult

watchOS:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -153,12 +147,10 @@ jobs:
run: make generate
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Flare" -destination "${{ matrix.destination }}" -testPlan UnitTests clean -enableCodeCoverage YES -resultBundlePath "./watchsimulator.xcresult" || exit 1
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
- uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./watchsimulator.xcresult"
name: watchos-coverage
path: ./watchsimulator.xcresult

spm:
name: ${{ matrix.name }}
Expand All @@ -181,6 +173,23 @@ jobs:
- name: ${{ matrix.name }}
run: swift build -c release --target Flare

upload-to-codecov:
needs: [iOS, macOS, watchOS, tvOS]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Merge downloaded files
run: ./scripts/merge_test_results.sh
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./final.xcresult"

# Beta:
# name: ${{ matrix.name }}
# runs-on: firebreak
Expand Down
2 changes: 2 additions & 0 deletions scripts/merge_test_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
files=$(find . -name '*.xcresult')
xcrun xcresulttool merge $files --output-path final.xcresult

0 comments on commit 60a60bb

Please sign in to comment.