From c318685874c8921a943599656aaccec176f16fa0 Mon Sep 17 00:00:00 2001 From: leogdion Date: Tue, 22 Oct 2024 14:42:20 -0400 Subject: [PATCH] merging from FelinePineLogging (#21) --- .github/workflows/FelinePine.yml | 62 ++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/.github/workflows/FelinePine.yml b/.github/workflows/FelinePine.yml index db38a6d..21609e7 100644 --- a/.github/workflows/FelinePine.yml +++ b/.github/workflows/FelinePine.yml @@ -60,12 +60,18 @@ jobs: run: swift build - name: Run tests run: swift test --enable-test-discovery --enable-code-coverage - - name: Prepare Code Coverage - run: llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov - - name: Upload to CodeCov.io - run: bash <(curl https://codecov.io/bash) -F spm -F ${RELEASE_NAME} -F ${SWIFT_VER} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: sersoft-gmbh/swift-coverage-action@v4 + id: coverage-files + with: + fail-on-empty-output: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + flags: swift-${{ matrix.swift-version }},ubuntu + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} build-macos: name: Build on macOS env: @@ -140,10 +146,15 @@ jobs: - name: Run Swift Package tests run: swift test -v --enable-code-coverage - uses: sersoft-gmbh/swift-coverage-action@v4 - - name: Upload SPM to CodeCov.io - run: bash <(curl https://codecov.io/bash) -F spm -F macOS -F ${XCODE_NAME} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + id: coverage-files-spm + with: + fail-on-empty-output: true + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + files: ${{ join(fromJSON(steps.coverage-files-spm.outputs.files), ',') }} + token: ${{ secrets.CODECOV_TOKEN }} + flags: macOS,${{ env.XCODE_NAME }},${{ matrix.runs-on }} - name: Clean up spm build directory run: rm -rf .build - name: Lint @@ -152,15 +163,28 @@ jobs: - name: Run iOS target tests run: xcodebuild test -scheme FelinePine -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 - - name: Upload iOS Coverage to CodeCov.io - run: bash <(curl https://codecov.io/bash) -F iOS -F iOS${{ matrix.iOSVersion }} -F macOS -F ${XCODE_NAME} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + id: coverage-files-iOS + with: + fail-on-empty-output: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }} + flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - name: Run watchOS target tests run: xcodebuild test -scheme FelinePine -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 - - name: Upload watchOS Coverage to CodeCov.io - run: bash <(curl https://codecov.io/bash) -F watchOS -F watchOS${{ matrix.watchOSVersion }} -F macOS -F ${XCODE_NAME} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - token: ${{ secrets.CODECOV_TOKEN }} + id: coverage-files-watchOS + with: + fail-on-empty-output: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }} + flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}