Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Cache Rust builds for CLI tests and Ensu desktop

Manav Rathicd9b54ab5c74
diff --git a/.github/workflows/ensu-build.yml b/.github/workflows/ensu-build.yml
index 20d7b81e20..dd40369562 100644
--- a/.github/workflows/ensu-build.yml
+++ b/.github/workflows/ensu-build.yml
@@ -147,6 +147,12 @@ jobs:
if: matrix.platform.rust-target == 'universal-apple-darwin'
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin
+ - name: Setup Rust cache
+ uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
+ with:
+ workspaces: rust
+ shared-key: ensu-desktop
+
- name: Install web dependencies
working-directory: web
run: npm ci
diff --git a/.github/workflows/rust-cli-test.yml b/.github/workflows/rust-cli-test.yml
index 075c19647d..1d09ec214e 100644
--- a/.github/workflows/rust-cli-test.yml
+++ b/.github/workflows/rust-cli-test.yml
@@ -21,6 +21,13 @@ jobs:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ - name: Restore Rust cache
+ uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
+ with:
+ workspaces: rust
+ shared-key: rust-cli
+ save-if: false
+
- name: Run with disposable signing and storage
run: |
umask 077
@@ -64,5 +71,12 @@ jobs:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ - name: Restore Rust cache
+ uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
+ with:
+ workspaces: rust
+ shared-key: rust-cli
+ save-if: false
+
- name: Run with Windows Credential Manager
run: python apps/cli-next/scripts/native-keyring.py test
diff --git a/.github/workflows/warm-caches.yml b/.github/workflows/warm-caches.yml
index 737afd998e..731be0ba23 100644
--- a/.github/workflows/warm-caches.yml
+++ b/.github/workflows/warm-caches.yml
@@ -2,7 +2,6 @@ name: "Warm caches"
# PR workflows cannot save caches that other PRs can restore.
# This main-only workflow primes shared caches; consumers use save-if: false.
-# Cache space is limited. Choose warming targets accordingly.
on:
schedule:
@@ -58,6 +57,29 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
+ rust-cli:
+ # For rust-cli-test.yml.
+ strategy:
+ matrix:
+ os: [macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ defaults:
+ run:
+ working-directory: rust
+ env:
+ RUSTFLAGS: -D warnings
+ steps:
+ - name: Checkout
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+
+ - name: Setup Rust cache
+ uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
+ with:
+ workspaces: rust
+ shared-key: rust-cli
+
+ - run: cargo test --locked -p ente-cli-next --test cli --no-run
+
rust-flutter:
# For the cargo steps of mobile-lint.yml.
runs-on: ubuntu-latest