From 2243ad95960d4358267159cb29fb4fc7f3db5e4a Mon Sep 17 00:00:00 2001 From: Xendarboh <1435589+xendarboh@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:56:51 -0700 Subject: [PATCH] ci: add rust cache to client workflows --- .../client-publish-to-auto-release.yml | 21 ++++++++++++------- .github/workflows/client-test-build-only.yml | 18 ++++++++++------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/client-publish-to-auto-release.yml b/.github/workflows/client-publish-to-auto-release.yml index 7c68745..d859b17 100644 --- a/.github/workflows/client-publish-to-auto-release.yml +++ b/.github/workflows/client-publish-to-auto-release.yml @@ -6,8 +6,7 @@ on: tags: - 'client@*' -# This is the example from the readme. -# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release. +# On each push of a certain tag it will create or update a GitHub release, build your app, and upload the artifacts to the release. jobs: publish-tauri: @@ -21,13 +20,19 @@ jobs: args: '--target aarch64-apple-darwin' - platform: 'macos-latest' # for Intel based macs. args: '--target x86_64-apple-darwin' - - platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04. + - platform: 'ubuntu-22.04' args: '' - platform: 'windows-latest' args: '' runs-on: ${{ matrix.platform }} steps: + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -50,11 +55,11 @@ jobs: # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: './apps/client/src-tauri -> target' + key: ${{ matrix.args }} - name: install frontend dependencies run: pnpm install --frozen-lockfile # change this to npm, pnpm or bun depending on which one you use. diff --git a/.github/workflows/client-test-build-only.yml b/.github/workflows/client-test-build-only.yml index eaf5843..3746879 100644 --- a/.github/workflows/client-test-build-only.yml +++ b/.github/workflows/client-test-build-only.yml @@ -15,13 +15,19 @@ jobs: args: '--target aarch64-apple-darwin' - platform: 'macos-latest' # for Intel based macs. args: '--target x86_64-apple-darwin' - - platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04. + - platform: 'ubuntu-22.04' args: '' - platform: 'windows-latest' args: '' runs-on: ${{ matrix.platform }} steps: + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -41,11 +47,11 @@ jobs: # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: './apps/client/src-tauri -> target' + key: ${{ matrix.args }} - name: install frontend dependencies run: pnpm install --frozen-lockfile # change this to npm, pnpm or bun depending on which one you use.