From f066ca2ae6ad53306eb5f09be1f42340281cc631 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 13:16:14 -0600 Subject: [PATCH 1/8] Replace rust-cache with sccache for better cache efficiency - Switches from caching entire target/ directory to compiler-level object caching - Expected to reduce cache size from ~15GB to ~5-6GB - Should improve cross-branch cache sharing (PRs can share compiled objects) - Adds sccache installation and configuration to all Rust build workflows: - android-build.yml - desktop-build.yml (macOS & Linux) - mobile-build.yml (iOS) - testflight-on-comment.yml - release.yml (macOS, Linux & Android) - claude.yml - Removes redundant Cargo registry caching (sccache handles this) - Sets SCCACHE_CACHE_SIZE=2G per workflow Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/android-build.yml | 37 ++++++++---- .github/workflows/claude.yml | 38 +++++++----- .github/workflows/desktop-build.yml | 49 ++++++++++++--- .github/workflows/mobile-build.yml | 22 +++++-- .github/workflows/release.yml | 67 +++++++++++++++------ .github/workflows/testflight-on-comment.yml | 22 +++++-- 6 files changed, 174 insertions(+), 61 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 3d8ff19a6..486f64b3e 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -61,22 +61,23 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true - - - name: Cache Cargo registry + - name: Install sccache + run: | + SCCACHE_VERSION=0.8.2 + SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" + curl -L "$SCCACHE_URL" | tar xz + sudo mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ + chmod +x /usr/local/bin/sccache + sccache --version + + - name: Cache sccache uses: actions/cache@v4 with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + path: ~/.cache/sccache + key: ${{ runner.os }}-sccache-android-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-registry- + ${{ runner.os }}-sccache-android- + ${{ runner.os }}-sccache- - name: Cache Cargo bin uses: actions/cache@v4 @@ -142,6 +143,13 @@ jobs: echo "Generated tauri.properties with version $VERSION and versionCode $VERSION_CODE" + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Build Tauri Android App (Signed Release) working-directory: ./frontend run: | @@ -184,6 +192,9 @@ jobs: VITE_MAPLE_BILLING_API_URL: ${{ github.event_name == 'pull_request' && 'https://billing-dev.opensecret.cloud' || 'https://billing.opensecret.cloud' }} VITE_CLIENT_ID: ba5a14b5-d915-47b1-b7b1-afda52bc5fc6 + - name: Show sccache stats + run: sccache --show-stats + - name: Upload Android APK uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 48799efd9..dd0ed86a8 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -70,11 +70,23 @@ jobs: with: targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache + run: | + SCCACHE_VERSION=0.8.2 + SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" + curl -L "$SCCACHE_URL" | tar xz + sudo mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ + chmod +x /usr/local/bin/sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ~/.cache/sccache + key: ${{ runner.os }}-sccache-claude-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-claude- + ${{ runner.os }}-sccache- - name: Cache APT packages uses: actions/cache@v4 @@ -101,17 +113,6 @@ jobs: working-directory: ./frontend run: bun install - - name: Cache Cargo registry - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - name: Cache Cargo bin uses: actions/cache@v4 with: @@ -120,6 +121,13 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-bin- + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Install Tauri CLI run: | if ! command -v cargo-tauri &> /dev/null; then diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 83f28be19..096555564 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -25,11 +25,19 @@ jobs: with: targets: aarch64-apple-darwin,x86_64-apple-darwin - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache + run: | + brew install sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ~/Library/Caches/Mozilla.sccache + key: ${{ runner.os }}-sccache-macos-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-macos- + ${{ runner.os }}-sccache- - name: Install dependencies (macOS) run: | @@ -39,6 +47,12 @@ jobs: working-directory: ./frontend run: bun install + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Import Apple Developer Certificate env: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} @@ -102,11 +116,23 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache + run: | + SCCACHE_VERSION=0.8.2 + SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" + curl -L "$SCCACHE_URL" | tar xz + sudo mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ + chmod +x /usr/local/bin/sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ~/.cache/sccache + key: ${{ runner.os }}-sccache-linux-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-linux- + ${{ runner.os }}-sccache- - name: Install Linux dependencies run: | @@ -130,6 +156,13 @@ jobs: env: CARGO_CFG_TARGET_OS: linux + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Build Tauri App (Linux) working-directory: ./frontend run: cargo tauri build diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index d35e69836..5de95f35e 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -22,11 +22,19 @@ jobs: with: targets: aarch64-apple-ios - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache + run: | + brew install sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ~/Library/Caches/Mozilla.sccache + key: ${{ runner.os }}-sccache-ios-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-ios- + ${{ runner.os }}-sccache- - name: Install dependencies (macOS) run: | @@ -54,6 +62,12 @@ jobs: echo "${{ secrets.APPLE_API_PRIVATE_KEY }}" | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 chmod 600 ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 echo "APPLE_API_KEY_PATH=~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8" >> $GITHUB_ENV + + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats - name: Build Tauri iOS App working-directory: ./frontend diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9afdf1eb..d7a2f822f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,11 +49,30 @@ jobs: with: targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache (macOS) + if: matrix.platform == 'macos-latest' + run: | + brew install sccache + sccache --version + + - name: Install sccache (Linux) + if: matrix.platform == 'ubuntu-latest' + run: | + SCCACHE_VERSION=0.8.2 + SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" + curl -L "$SCCACHE_URL" | tar xz + sudo mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ + chmod +x /usr/local/bin/sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ${{ matrix.platform == 'macos-latest' && '~/Library/Caches/Mozilla.sccache' || '~/.cache/sccache' }} + key: ${{ runner.os }}-sccache-release-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-release- + ${{ runner.os }}-sccache- - name: Install dependencies (macOS) if: matrix.platform == 'macos-latest' @@ -78,6 +97,12 @@ jobs: working-directory: ./frontend run: bun install + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Build Tauri App uses: tauri-apps/tauri-action@v0 env: @@ -157,22 +182,23 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true - - - name: Cache Cargo registry + - name: Install sccache + run: | + SCCACHE_VERSION=0.8.2 + SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" + curl -L "$SCCACHE_URL" | tar xz + sudo mv sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache /usr/local/bin/ + chmod +x /usr/local/bin/sccache + sccache --version + + - name: Cache sccache uses: actions/cache@v4 with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + path: ~/.cache/sccache + key: ${{ runner.os }}-sccache-android-release-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-registry- + ${{ runner.os }}-sccache-android-release- + ${{ runner.os }}-sccache- - name: Cache Cargo bin uses: actions/cache@v4 @@ -238,6 +264,13 @@ jobs: echo "Generated tauri.properties with version $VERSION and versionCode $VERSION_CODE" + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats + - name: Build Tauri Android App (Signed Release) working-directory: ./frontend run: | diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index 1678fce2d..214d6e41f 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -80,11 +80,19 @@ jobs: with: targets: aarch64-apple-ios - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Install sccache + run: | + brew install sccache + sccache --version + + - name: Cache sccache + uses: actions/cache@v4 with: - workspaces: "frontend/src-tauri -> target" - cache-on-failure: true + path: ~/Library/Caches/Mozilla.sccache + key: ${{ runner.os }}-sccache-testflight-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-sccache-testflight- + ${{ runner.os }}-sccache- - name: Install dependencies (macOS) run: | @@ -112,6 +120,12 @@ jobs: echo "${{ secrets.APPLE_API_PRIVATE_KEY }}" | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 chmod 600 ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 echo "APPLE_API_KEY_PATH=~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8" >> $GITHUB_ENV + + - name: Configure sccache + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV + sccache --show-stats - name: Build Tauri iOS App working-directory: ./frontend From 54fd935edf37740f1ad9fe6f1e3b86e509366c8a Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 14:00:51 -0600 Subject: [PATCH 2/8] Replace sccache with xcode-cache for iOS builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sccache doesn't work with Xcode builds because Xcode's build scripts don't inherit RUSTC_WRAPPER environment variable. Instead, use irgaly/xcode-cache which caches DerivedData and SourcePackages for faster incremental builds. Expected improvement: 40-60% faster iOS builds (20min → 8-12min) Changes: - mobile-build.yml: Replace sccache setup with xcode-cache action - testflight-on-comment.yml: Replace sccache setup with xcode-cache action - Removed Configure sccache step (not needed for Xcode builds) - Keep sccache for Android, Linux, macOS desktop (working well) Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/mobile-build.yml | 22 +++++---------------- .github/workflows/testflight-on-comment.yml | 22 +++++---------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index 5de95f35e..5efb8d7b0 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -22,19 +22,13 @@ jobs: with: targets: aarch64-apple-ios - - name: Install sccache - run: | - brew install sccache - sccache --version - - - name: Cache sccache - uses: actions/cache@v4 + - name: Cache Xcode DerivedData and SourcePackages + uses: irgaly/xcode-cache@v1 with: - path: ~/Library/Caches/Mozilla.sccache - key: ${{ runner.os }}-sccache-ios-${{ hashFiles('**/Cargo.lock') }} + key: xcode-cache-ios-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-sccache-ios- - ${{ runner.os }}-sccache- + xcode-cache-ios-${{ github.workflow }}- + xcode-cache-ios- - name: Install dependencies (macOS) run: | @@ -62,12 +56,6 @@ jobs: echo "${{ secrets.APPLE_API_PRIVATE_KEY }}" | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 chmod 600 ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 echo "APPLE_API_KEY_PATH=~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8" >> $GITHUB_ENV - - - name: Configure sccache - run: | - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri iOS App working-directory: ./frontend diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index 214d6e41f..c193ed9a1 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -80,19 +80,13 @@ jobs: with: targets: aarch64-apple-ios - - name: Install sccache - run: | - brew install sccache - sccache --version - - - name: Cache sccache - uses: actions/cache@v4 + - name: Cache Xcode DerivedData and SourcePackages + uses: irgaly/xcode-cache@v1 with: - path: ~/Library/Caches/Mozilla.sccache - key: ${{ runner.os }}-sccache-testflight-${{ hashFiles('**/Cargo.lock') }} + key: xcode-cache-testflight-${{ github.workflow }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-sccache-testflight- - ${{ runner.os }}-sccache- + xcode-cache-testflight-${{ github.workflow }}- + xcode-cache-testflight- - name: Install dependencies (macOS) run: | @@ -120,12 +114,6 @@ jobs: echo "${{ secrets.APPLE_API_PRIVATE_KEY }}" | base64 --decode > ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 chmod 600 ~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8 echo "APPLE_API_KEY_PATH=~/.private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8" >> $GITHUB_ENV - - - name: Configure sccache - run: | - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri iOS App working-directory: ./frontend From d6c038fd6efe39c1fd935048352065476ce0221a Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 14:36:37 -0600 Subject: [PATCH 3/8] Fix inconsistent Tauri CLI caching and move sccache stats to after builds Issues fixed: 1. Linux desktop build was not checking if tauri-cli already installed - Added conditional check to skip 2-3 minute compile if already cached 2. iOS and TestFlight builds were not checking for cached tauri-cli - Added conditional checks for consistency 3. sccache --show-stats was running BEFORE builds (showing zeros) - Moved to AFTER builds to show actual cache hit rates This should save 2-3 minutes on Linux desktop builds when tauri-cli is cached. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/android-build.yml | 1 - .github/workflows/claude.yml | 1 - .github/workflows/desktop-build.yml | 15 ++++++++++++--- .github/workflows/mobile-build.yml | 7 ++++++- .github/workflows/release.yml | 2 -- .github/workflows/testflight-on-comment.yml | 7 ++++++- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 486f64b3e..9f74d467e 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -148,7 +148,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri Android App (Signed Release) working-directory: ./frontend diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index dd0ed86a8..979d2d19d 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -126,7 +126,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Install Tauri CLI run: | diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 096555564..6b199a581 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -51,7 +51,6 @@ jobs: run: | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Import Apple Developer Certificate env: @@ -94,6 +93,9 @@ jobs: projectPath: './frontend' args: --target ${{ matrix.target }} + - name: Show sccache stats + run: sccache --show-stats + - name: Upload macOS Build uses: actions/upload-artifact@v4 with: @@ -152,7 +154,12 @@ jobs: run: bun install - name: Install Tauri CLI - run: cargo install tauri-cli --version "2.9.2" --locked + run: | + if ! command -v cargo-tauri &> /dev/null; then + cargo install tauri-cli --version "2.9.2" --locked + else + echo "Tauri CLI already installed" + fi env: CARGO_CFG_TARGET_OS: linux @@ -161,7 +168,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri App (Linux) working-directory: ./frontend @@ -173,6 +179,9 @@ jobs: VITE_MAPLE_BILLING_API_URL: ${{ github.event_name == 'pull_request' && 'https://billing-dev.opensecret.cloud' || 'https://billing.opensecret.cloud' }} VITE_CLIENT_ID: ba5a14b5-d915-47b1-b7b1-afda52bc5fc6 + - name: Show sccache stats + run: sccache --show-stats + - name: Upload Linux Builds uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index 5efb8d7b0..e97d6eed3 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -44,7 +44,12 @@ jobs: xcode-version: '16.4' - name: Install Tauri CLI - run: cargo install tauri-cli --version "2.9.2" --locked + run: | + if ! command -v cargo-tauri &> /dev/null; then + cargo install tauri-cli --version "2.9.2" --locked + else + echo "Tauri CLI already installed" + fi env: # Workaround for getrandom v0.2.16 (https://github.com/rust-random/getrandom/issues/641) # cargo install builds for the host; on macOS runners target_os is "macos" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7a2f822f..6c7c5945e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,6 @@ jobs: run: | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri App uses: tauri-apps/tauri-action@v0 @@ -269,7 +268,6 @@ jobs: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV - sccache --show-stats - name: Build Tauri Android App (Signed Release) working-directory: ./frontend diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index c193ed9a1..f475d485d 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -102,7 +102,12 @@ jobs: xcode-version: '16.4' - name: Install Tauri CLI - run: cargo install tauri-cli --version "2.9.2" --locked + run: | + if ! command -v cargo-tauri &> /dev/null; then + cargo install tauri-cli --version "2.9.2" --locked + else + echo "Tauri CLI already installed" + fi env: # Workaround for getrandom v0.2.16 (https://github.com/rust-random/getrandom/issues/641) # cargo install builds for the host; on macOS runners target_os is "macos" From 0ecd3257a6ab84df9a98202fe4958be0c8cf45cc Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 14:40:02 -0600 Subject: [PATCH 4/8] Add Cargo bin caching for iOS/TestFlight workflows iOS workflows were missing the Cargo bin cache that Android/Linux have, causing tauri-cli to recompile every time (2-3 minutes). This should save 2-3 minutes on iOS builds when tauri-cli is cached. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/mobile-build.yml | 9 +++++++++ .github/workflows/testflight-on-comment.yml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index e97d6eed3..ca69b253d 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -30,6 +30,15 @@ jobs: xcode-cache-ios-${{ github.workflow }}- xcode-cache-ios- + - name: Cache Cargo bin (Tauri CLI) + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/ + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 + restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- + ${{ runner.os }}-cargo-bin- + - name: Install dependencies (macOS) run: | brew install openssl@3 diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index f475d485d..b045882e0 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -88,6 +88,15 @@ jobs: xcode-cache-testflight-${{ github.workflow }}- xcode-cache-testflight- + - name: Cache Cargo bin (Tauri CLI) + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/ + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 + restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- + ${{ runner.os }}-cargo-bin- + - name: Install dependencies (macOS) run: | brew install openssl@3 From 47234fcc593ce2117bcf76d67b90414e5f476293 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 14:45:44 -0600 Subject: [PATCH 5/8] Standardize Cargo bin caching across all workflows Issues fixed: 1. Linux desktop missing Cargo bin cache entirely - Added cache step to avoid recompiling tauri-cli (saves 2-3min) 2. Inconsistent cache keys in android-build, claude, and release - Changed from "cargo-bin-tauri-cli" to "cargo-bin-tauri-cli-2.9.2" - Ensures cache invalidation when CLI version changes All workflows now use consistent: - Name: "Cache Cargo bin (Tauri CLI)" - Key: "${{ runner.os }}-cargo-bin-tauri-cli-2.9.2" - Restore keys with version fallback This completes the tauri-cli caching standardization across 6 workflows. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/android-build.yml | 5 +++-- .github/workflows/claude.yml | 5 +++-- .github/workflows/desktop-build.yml | 9 +++++++++ .github/workflows/release.yml | 5 +++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 9f74d467e..cb65d5126 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -79,12 +79,13 @@ jobs: ${{ runner.os }}-sccache-android- ${{ runner.os }}-sccache- - - name: Cache Cargo bin + - name: Cache Cargo bin (Tauri CLI) uses: actions/cache@v4 with: path: ~/.cargo/bin/ - key: ${{ runner.os }}-cargo-bin-tauri-cli + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - name: Cache APT packages diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 979d2d19d..20f2ad7a8 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -113,12 +113,13 @@ jobs: working-directory: ./frontend run: bun install - - name: Cache Cargo bin + - name: Cache Cargo bin (Tauri CLI) uses: actions/cache@v4 with: path: ~/.cargo/bin/ - key: ${{ runner.os }}-cargo-bin-tauri-cli + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - name: Configure sccache diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 6b199a581..364d343d4 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -136,6 +136,15 @@ jobs: ${{ runner.os }}-sccache-linux- ${{ runner.os }}-sccache- + - name: Cache Cargo bin (Tauri CLI) + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/ + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 + restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- + ${{ runner.os }}-cargo-bin- + - name: Install Linux dependencies run: | sudo apt-get update diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c7c5945e..65d73b48f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -199,12 +199,13 @@ jobs: ${{ runner.os }}-sccache-android-release- ${{ runner.os }}-sccache- - - name: Cache Cargo bin + - name: Cache Cargo bin (Tauri CLI) uses: actions/cache@v4 with: path: ~/.cargo/bin/ - key: ${{ runner.os }}-cargo-bin-tauri-cli + key: ${{ runner.os }}-cargo-bin-tauri-cli-2.9.2 restore-keys: | + ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - name: Cache APT packages From 9e8cfad7b9e3f17f160df7ead48494941f8cae85 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 15:49:07 -0600 Subject: [PATCH 6/8] Add high-value, low-risk workflow optimizations Optimizations implemented: 1. Remove unnecessary APT packages (build-essential, curl, wget, file) - Already pre-installed on GitHub runners - Saves 30-60s per Linux build 2. Enable Gradle optimizations in gradle.properties - org.gradle.parallel=true (parallel project execution) - org.gradle.daemon=true (keeps daemon running) - org.gradle.caching=true (enable build cache) - org.gradle.configureondemand=true (configure only needed projects) - Expected: 10-20% faster Android builds (1-2min) 3. Add Homebrew caching to macOS workflows - Cache ~/Library/Caches/Homebrew - Cache installed packages (sccache, openssl@3) - Saves 2-4 minutes per macOS build 4. Remove ineffective APT cache steps - APT archives often cleared, provides minimal benefit - Better to just install fewer packages Expected total savings: - Linux builds: 30-60s - Android builds: 1-3 minutes - macOS builds: 2-4 minutes Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/android-build.yml | 9 ------- .github/workflows/claude.yml | 12 --------- .github/workflows/desktop-build.yml | 15 ++++++++--- .github/workflows/mobile-build.yml | 10 ++++++++ .github/workflows/release.yml | 25 +++++++++---------- .github/workflows/testflight-on-comment.yml | 10 ++++++++ .../src-tauri/gen/android/gradle.properties | 5 +++- 7 files changed, 47 insertions(+), 39 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index cb65d5126..ee13d618b 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -88,15 +88,6 @@ jobs: ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - - name: Cache APT packages - uses: actions/cache@v4 - with: - path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-android-${{ hashFiles('.github/workflows/android-build.yml') }} - restore-keys: | - ${{ runner.os }}-apt-android- - ${{ runner.os }}-apt- - - name: Install Linux dependencies run: | sudo apt-get update diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 20f2ad7a8..e5d1faaa8 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -88,22 +88,10 @@ jobs: ${{ runner.os }}-sccache-claude- ${{ runner.os }}-sccache- - - name: Cache APT packages - uses: actions/cache@v4 - with: - path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/claude.yml') }} - restore-keys: | - ${{ runner.os }}-apt- - - name: Install Linux dependencies run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev \ - build-essential \ - curl \ - wget \ - file \ libssl-dev \ libgtk-3-dev \ libayatana-appindicator3-dev \ diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 364d343d4..99b6cf71b 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -25,6 +25,17 @@ jobs: with: targets: aarch64-apple-darwin,x86_64-apple-darwin + - name: Cache Homebrew + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/sccache + /opt/homebrew/Cellar/openssl@3 + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/desktop-build.yml') }} + restore-keys: | + ${{ runner.os }}-brew- + - name: Install sccache run: | brew install sccache @@ -149,10 +160,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev \ - build-essential \ - curl \ - wget \ - file \ libssl-dev \ libgtk-3-dev \ libayatana-appindicator3-dev \ diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index ca69b253d..ad7c8f86a 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -22,6 +22,16 @@ jobs: with: targets: aarch64-apple-ios + - name: Cache Homebrew + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/openssl@3 + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/mobile-build.yml') }} + restore-keys: | + ${{ runner.os }}-brew- + - name: Cache Xcode DerivedData and SourcePackages uses: irgaly/xcode-cache@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65d73b48f..fb475e39e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,18 @@ jobs: with: targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} + - name: Cache Homebrew + if: matrix.platform == 'macos-latest' + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/sccache + /opt/homebrew/Cellar/openssl@3 + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/release.yml') }} + restore-keys: | + ${{ runner.os }}-brew- + - name: Install sccache (macOS) if: matrix.platform == 'macos-latest' run: | @@ -84,10 +96,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev \ - build-essential \ - curl \ - wget \ - file \ libssl-dev \ libgtk-3-dev \ libayatana-appindicator3-dev \ @@ -208,15 +216,6 @@ jobs: ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - - name: Cache APT packages - uses: actions/cache@v4 - with: - path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-android-${{ hashFiles('.github/workflows/release.yml') }} - restore-keys: | - ${{ runner.os }}-apt-android- - ${{ runner.os }}-apt- - - name: Install Linux dependencies run: | sudo apt-get update diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index b045882e0..c0525413e 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -80,6 +80,16 @@ jobs: with: targets: aarch64-apple-ios + - name: Cache Homebrew + uses: actions/cache@v4 + with: + path: | + ~/Library/Caches/Homebrew + /opt/homebrew/Cellar/openssl@3 + key: ${{ runner.os }}-brew-${{ hashFiles('.github/workflows/testflight-on-comment.yml') }} + restore-keys: | + ${{ runner.os }}-brew- + - name: Cache Xcode DerivedData and SourcePackages uses: irgaly/xcode-cache@v1 with: diff --git a/frontend/src-tauri/gen/android/gradle.properties b/frontend/src-tauri/gen/android/gradle.properties index 2a7ec6959..da30958b8 100644 --- a/frontend/src-tauri/gen/android/gradle.properties +++ b/frontend/src-tauri/gen/android/gradle.properties @@ -10,7 +10,10 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +org.gradle.parallel=true +org.gradle.daemon=true +org.gradle.caching=true +org.gradle.configureondemand=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app"s APK # https://developer.android.com/topic/libraries/support-library/androidx-rn From e8f8143ac4b8ca257960baf44dc5305788814831 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 16:08:36 -0600 Subject: [PATCH 7/8] Revert Homebrew conditional checks and remove unnecessary openssl@3 Issue: When Homebrew cache is restored, packages are cached but symlinks to PATH are not preserved. This causes 'command not found' errors even though the package exists in the cache. Changes: 1. Reverted conditional checks for sccache and openssl@3 2. Keep 'brew install sccache' - needed to link after cache restore 3. Remove 'brew install openssl@3' - pre-installed on GitHub macOS runners Result: Homebrew cache still works, sccache gets linked properly, and we save 2 seconds per macOS/iOS build by not reinstalling openssl@3. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .github/workflows/desktop-build.yml | 5 +---- .github/workflows/mobile-build.yml | 4 ---- .github/workflows/release.yml | 6 +----- .github/workflows/testflight-on-comment.yml | 4 ---- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 99b6cf71b..d9cd1b6ce 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -39,6 +39,7 @@ jobs: - name: Install sccache run: | brew install sccache + brew link --overwrite --force sccache sccache --version - name: Cache sccache @@ -50,10 +51,6 @@ jobs: ${{ runner.os }}-sccache-macos- ${{ runner.os }}-sccache- - - name: Install dependencies (macOS) - run: | - brew install openssl@3 - - name: Install frontend dependencies working-directory: ./frontend run: bun install diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index ad7c8f86a..307c80914 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -49,10 +49,6 @@ jobs: ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - - name: Install dependencies (macOS) - run: | - brew install openssl@3 - - name: Install frontend dependencies working-directory: ./frontend run: bun install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb475e39e..af9817880 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,6 +65,7 @@ jobs: if: matrix.platform == 'macos-latest' run: | brew install sccache + brew link --overwrite --force sccache sccache --version - name: Install sccache (Linux) @@ -86,11 +87,6 @@ jobs: ${{ runner.os }}-sccache-release- ${{ runner.os }}-sccache- - - name: Install dependencies (macOS) - if: matrix.platform == 'macos-latest' - run: | - brew install openssl@3 - - name: Install dependencies (Linux) if: matrix.platform == 'ubuntu-latest' run: | diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index c0525413e..9b46df1f1 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -107,10 +107,6 @@ jobs: ${{ runner.os }}-cargo-bin-tauri-cli- ${{ runner.os }}-cargo-bin- - - name: Install dependencies (macOS) - run: | - brew install openssl@3 - - name: Install frontend dependencies working-directory: ./frontend run: bun install From ee1740868070bf5c7a672a5b3fba82a6abb614d0 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 12 Nov 2025 16:47:06 -0600 Subject: [PATCH 8/8] Trigger cold cache build test All GitHub Actions caches have been cleared to verify cold start performance with the new sccache and caching optimizations. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>