ci: move artifact clean and add rust cache

This commit is contained in:
Caelan Sayler
2024-03-27 15:35:18 +00:00
parent c48a0d085a
commit a400708fd4

View File

@@ -21,6 +21,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
with:
key: "rust-test-${{ matrix.os }}"
workspaces: "src/Rust -> target"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install NBGV
@@ -52,6 +56,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
with:
key: "rust-build-${{ matrix.os }}"
workspaces: "src/Rust -> target"
- name: Install NBGV
run: dotnet tool install -g nbgv
if: ${{ matrix.os == 'macos-latest' }}
@@ -73,7 +81,7 @@ jobs:
working-directory: src/Rust/target/release
run: cp update UpdateMac
if: ${{ matrix.os == 'macos-latest' }}
- name: Upload Rust Artifacts
- name: Upload Rust Build Artifacts
uses: actions/upload-artifact@v4
with:
name: rust-${{ matrix.os }}
@@ -96,7 +104,7 @@ jobs:
fetch-depth: 0
- name: Build .NET
run: dotnet build -c Release
- name: Upload Build Artifacts
- name: Upload Dotnet Build Artifacts
uses: actions/upload-artifact@v4
with:
name: dotnet-${{ matrix.os }}
@@ -128,10 +136,6 @@ jobs:
with:
name: dotnet-${{ matrix.os }}
path: build
- name: Delete Dotnet Artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: dotnet-${{ matrix.os }}
- name: Test .NET Velopack.Tests
run: dotnet test --no-build -c Release -l "console;verbosity=detailed" test/Velopack.Tests/Velopack.Tests.csproj
- name: Test .NET Velopack.Packaging.Tests
@@ -145,6 +149,16 @@ jobs:
with:
directory: ./test
fail_ci_if_error: true
clean-artifacts:
if: ${{ always() }}
needs: [build-dotnet, test-dotnet]
runs-on: ubuntu-latest
steps:
- name: Delete Dotnet Artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: dotnet-*
package:
runs-on: ubuntu-latest