ci: only upload coverage after packaging

This commit is contained in:
Caelan Sayler
2023-12-26 01:38:32 +00:00
parent f7bd4c6075
commit 1cf91f9f2c

View File

@@ -9,7 +9,7 @@ jobs:
os: [macos-latest, windows-latest] os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -67,18 +67,16 @@ jobs:
src/Rust/target/release/*.exe src/Rust/target/release/*.exe
- name: Upload Coverage - name: Upload Coverage
uses: codecov/codecov-action@v3 uses: actions/upload-artifact@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with: with:
directory: ./test name: coverage
fail_ci_if_error: true path: test/coverage*.xml
package: package:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build] needs: [build]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -108,6 +106,12 @@ jobs:
name: rust name: rust
path: src/Rust/target/release path: src/Rust/target/release
- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
name: coverage
path: ./coverage
- name: Build .NET - name: Build .NET
run: dotnet build -c Release /p:PackRustAssets=true run: dotnet build -c Release /p:PackRustAssets=true
@@ -117,6 +121,14 @@ jobs:
name: packages name: packages
path: .\build\Release\*.nupkg 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 - name: Publish to GitHub Packages
shell: pwsh 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 run: dotnet nuget push .\build\Release\*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate