From a400708fd42867c681bbd8b77b6533e93caae3bb Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Wed, 27 Mar 2024 15:35:18 +0000 Subject: [PATCH] ci: move artifact clean and add rust cache --- .github/workflows/build.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ae308ef..514c7350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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