diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index dd297da..d40b404 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -79,19 +79,22 @@ jobs: CovResultsPath: "${{ runner.temp }}\\cov_results\\cov.xml" TestResultsPath: "${{ runner.temp }}\\results" # Note: Need to move coverage file due to ongoing bugs with finding coverage files names differently than - # tool defaults and put under folders away from working directory + # tool defaults and put under folders away from working directory in codecov v4 + # code based on https://devblogs.microsoft.com/powershell-community/determine-if-a-folder-exists/ - name: Move coverage file for upload if: success() || failure() - run: Move-Item -Path ${{ runner.temp }}\cov_results\cov.xml -Destination ${{ github.workspace }}\TestResults\coverage.xml + run: |- + $dest = ${{ github.workspace }}\TestResults + if (-Not (Test-Path -Path $dest)) { + New-Item -ItemType "directory" -Path $dest + } + Move-Item -Path ${{ runner.temp }}\cov_results\cov.xml -Destination $dest\coverage.xml shell: pwsh - name: Upload Coverage if: success() || failure() uses: codecov/codecov-action@v4 with: - # Hard copy from step above due to https://github.com/actions/runner/issues/2204 - # In principle we could also omit directory and files due to the note above - directory: ${{ github.workspace }}/TestResults - files: coverage.xml + # Relying on built-in search logic due to note above fail_ci_if_error: true verbose: true token: ${{ secrets.CODECOV_TOKEN }}