From 7f8a9825dd8594df07bc8b612b6a1bf36a4227d1 Mon Sep 17 00:00:00 2001 From: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com> Date: Thu, 15 May 2025 22:11:04 +0200 Subject: [PATCH] [PM-18502] jest and rust coverage upload separated as one step (#14286) * jest and rust coverage upload separated as one step * wrong file paths when downloading coverage * correct relative coverage paths with sources * Update .github/workflows/test.yml Co-authored-by: Matt Bishop --------- Co-authored-by: Matt Bishop --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50f04ebaeb1..64cc86f1db6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: - "rc" - "hotfix-rc-*" pull_request: - types: [opened, synchronize] + types: [ opened, synchronize ] jobs: @@ -66,12 +66,15 @@ jobs: reporter: jest-junit fail-on-error: true - - name: Upload coverage to codecov.io - uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 - - name: Upload results to codecov.io uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0 + - name: Upload test coverage + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + with: + name: jest-coverage + path: ./coverage/lcov.info + rust: name: Run Rust tests on ${{ matrix.os }} runs-on: ${{ matrix.os || 'ubuntu-22.04' }} @@ -148,7 +151,37 @@ jobs: working-directory: ./apps/desktop/desktop_native run: cargo llvm-cov --all-features --lcov --output-path lcov.info --workspace --no-cfg-coverage - - name: Upload to codecov.io + - name: Upload test coverage + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + with: + name: rust-coverage + path: ./apps/desktop/desktop_native/lcov.info + + upload-codecov: + name: Upload to Codecov + runs-on: ubuntu-22.04 + needs: + - testing + - rust-coverage + steps: + - name: Check out repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Download jest coverage + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: jest-coverage + path: ./ + + - name: Download rust coverage + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: rust-coverage + path: ./apps/desktop/desktop_native + + - name: Upload coverage to codecov.io uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 with: - files: ./apps/desktop/desktop_native/lcov.info + files: | + ./lcov.info + ./apps/desktop/desktop_native/lcov.info