From 1cf91f9f2c1c429efd736f9dca3d28b0986eebd1 Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Tue, 26 Dec 2023 01:38:32 +0000 Subject: [PATCH] ci: only upload coverage after packaging --- .github/workflows/build.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41593389..f0c3f0b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: os: [macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -67,18 +67,16 @@ jobs: src/Rust/target/release/*.exe - name: Upload Coverage - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + uses: actions/upload-artifact@v3 with: - directory: ./test - fail_ci_if_error: true + name: coverage + path: test/coverage*.xml package: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -108,6 +106,12 @@ jobs: name: rust path: src/Rust/target/release + - name: Download Coverage Artifacts + uses: actions/download-artifact@v4 + with: + name: coverage + path: ./coverage + - name: Build .NET run: dotnet build -c Release /p:PackRustAssets=true @@ -117,6 +121,14 @@ jobs: name: packages path: .\build\Release\*.nupkg + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + directory: ./coverage + fail_ci_if_error: true + - name: Publish to GitHub Packages shell: pwsh run: dotnet nuget push .\build\Release\*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate \ No newline at end of file