From 7af6e86f9c203e6fe439b54be4e30a238818f5c7 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Thu, 1 Feb 2024 14:38:44 -0800 Subject: [PATCH] fix(actions): cache and pnpm --- .github/workflows/build.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87d1a97..456e121 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,17 +29,34 @@ jobs: feature: ["--no-default-features", "--all-features"] steps: + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: pnpm/action-setup@v2 + if: matrix.platform == 'windows-latest' + with: + version: 8.6.7 + - uses: oven-sh/setup-bun@v1 if: matrix.platform != 'windows-latest' with: bun-version: latest - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 if: matrix.platform == 'windows-latest' with: node-version: '20.x' - - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + updater/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/checkout@v4 - name: Install dependencies if: matrix.platform != 'windows-latest' @@ -47,7 +64,7 @@ jobs: - name: Install dependencies (Windows) if: matrix.platform == 'windows-latest' - run: cd frontend && npm install + run: cd frontend && pnpm install - name: Build if: matrix.platform != 'windows-latest' @@ -55,7 +72,7 @@ jobs: - name: Build (Windows) if: matrix.platform == 'windows-latest' - run: cd ./frontend && npm run build && cd ../backend && cargo build --release ${{ matrix.feature }} + run: cd ./frontend && pnpm run build && cd ../backend && cargo build --release ${{ matrix.feature }} - name: Upload uses: actions/upload-artifact@v4