Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
ci: only upload coverage after packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Dec 26, 2023
1 parent f7bd4c6 commit 1cf91f9
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

0 comments on commit 1cf91f9

Please sign in to comment.