Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Builds restore compiled dependencies from main, which a daily job keeps

denfrya4bac27cd473
diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml
new file mode 100644
index 00000000..7c93e8f5
--- /dev/null
+++ b/.github/workflows/cache.yml
@@ -0,0 +1,65 @@
+name: Build cache
+
+# The compiled dependencies that CI and the release restore (Swatinem/rust-cache), made here on main and nowhere else.
+#
+# A run can restore a cache of its own branch or tag, or of the default branch: a release tag never sees the cache of the tag
+# before it, and a pull request saved one only it could use. So every CI run and every release compiled all the dependencies
+# from nothing. Those now only read (save-if: false), and this workflow keeps one cache per build on main: "test" (cargo test's
+# debug build), "release-x64" and "release-arm64". The workspace's own crates are never cached, so a cache only goes stale when
+# the dependencies or the toolchain change: Cargo.lock and the manifests on a push, a new stable Rust on the daily run. When
+# the cache for the current state already exists, a job ends after looking it up.
+on:
+ push:
+ branches: [main]
+ paths:
+ - Cargo.lock
+ - "**/Cargo.toml"
+ - .cargo/config.toml
+ - .github/workflows/cache.yml
+ schedule:
+ - cron: "37 2 * * *"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: build-cache-${{ github.ref }}
+
+jobs:
+ cache:
+ name: cache (${{ matrix.key }})
+ runs-on: windows-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ # (each the build of the job that restores it: CI's tests, the release builds and CI's ones of the same profile)
+ - key: test
+ rust-target: x86_64-pc-windows-msvc
+ build: cargo test --workspace --locked --no-run
+ - key: release-x64
+ rust-target: x86_64-pc-windows-msvc
+ build: cargo build --release --locked -p rf-app -p rf-dialog -p rf-shellguard
+ - key: release-arm64
+ rust-target: aarch64-pc-windows-msvc
+ build: cargo build --release --locked --target aarch64-pc-windows-msvc -p rf-app -p rf-dialog -p rf-shellguard
+ steps:
+ - uses: actions/checkout@v4
+ - name: Rust
+ # the "stable" branch, pinned to its commit (pinned, it needs the toolchain named)
+ uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca
+ with:
+ toolchain: stable
+ targets: ${{ matrix.rust-target }}
+ - name: Build cache
+ # v2, pinned to its commit
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
+ id: cache
+ with:
+ shared-key: ${{ matrix.key }}
+ # (only looks: an exact hit needs no build and no save; anything else is built from nothing and saved at the end)
+ lookup-only: true
+ - name: Build
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: ${{ matrix.build }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0cbaee21..c25c1c1a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,6 +14,10 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: test
+ # (only read: the caches are made on main by cache.yml, which a pull request or a tag can restore from)
+ save-if: false
- name: Test
run: cargo test --workspace
@@ -31,6 +35,9 @@ jobs:
- name: Build cache
# v2, pinned to its commit
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
+ with:
+ shared-key: release-x64
+ save-if: false
- name: Release build
run: cargo build --release -p rf-app -p rf-dialog
@@ -44,6 +51,9 @@ jobs:
with:
targets: aarch64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
+ with:
+ shared-key: release-arm64
+ save-if: false
- name: Release build (ARM64)
run: cargo build --release --locked --target aarch64-pc-windows-msvc -p rf-app -p rf-dialog -p rf-shellguard
- uses: actions/upload-artifact@v4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ca68c1c3..6da233fb 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -48,8 +48,9 @@ jobs:
# v2, pinned to its commit
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0
with:
- # (both builds are the job "build": without this the two would share one cache key)
- key: ${{ matrix.arch }}
+ # (only read: a tag can restore only from main's caches, which cache.yml makes)
+ shared-key: release-${{ matrix.arch }}
+ save-if: false
- name: Build
# (rf-shellguard: the small program that puts Explorer's taskbar back if the dock dies; without it the dock leaves the taskbar alone)
# (--locked: the release is built from Cargo.lock as committed, the way CI builds ARM64, and stops if the lock is out of date)