From 29469001e807bf9b1b8b2396a3991fe239109d93 Mon Sep 17 00:00:00 2001 From: SondreB Date: Sat, 14 Dec 2024 14:57:03 +0100 Subject: [PATCH] Improve build performance with caching --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2255f96d..ac03e7d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,33 @@ jobs: with: dotnet-version: '8.0.x' + - name: Install Rust (Stable) + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + # Add Rust cargo cache + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + # Add npm cache + - uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Variables run: | echo VERSION=$(npm run version --silent) >> $GITHUB_ENV @@ -80,12 +107,6 @@ jobs: name: angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip path: angor-web-${{ env.VERSION }}-${{ matrix.runtime }}.zip - - name: Install Rust (Stable) - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Install Linux dependencies if: matrix.os == 'ubuntu-latest' run: |