diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e4d7f1e6..0a5fc6c32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/codecov-action@v3.1.0 + - 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 }} @@ -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/codecov-action@v3.1.0 + - 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 }} @@ -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/codecov-action@v3.1.0 + - 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 }} @@ -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/codecov-action@v3.1.0 + - 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 }} @@ -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/codecov-action@v3.1.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + xcode: true + xcode_archive_path: "./final.xcresult" + # Beta: # name: ${{ matrix.name }} # runs-on: firebreak diff --git a/scripts/merge_test_results.sh b/scripts/merge_test_results.sh new file mode 100755 index 000000000..8bda0db60 --- /dev/null +++ b/scripts/merge_test_results.sh @@ -0,0 +1,2 @@ +files=$(find . -name '*.xcresult') +xcrun xcresulttool merge $files --output-path final.xcresult \ No newline at end of file