Skip to content

Commit

Permalink
fix(actions): cache and pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Feb 1, 2024
1 parent 1d5087b commit 7af6e86
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,50 @@ 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'
run: cd frontend && bun install

- 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'
run: cd ./frontend && bun run build && cd ../backend && cargo build --release ${{ matrix.feature }}

- 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
Expand Down

0 comments on commit 7af6e86

Please sign in to comment.