mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-12 10:34:24 +08:00
ci: 优化 Cargo 构建缓存
- 共享 deb 与 Docker 的 Linux cross 编译缓存 - 为 Windows MSVC 构建添加独立缓存 - 固定 cross 版本以保证缓存一致性
This commit is contained in:
10
.github/workflows/docker.yml
vendored
10
.github/workflows/docker.yml
vendored
@@ -42,11 +42,19 @@ jobs:
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
# Reuse dependency artifacts produced by the deb job and vice versa.
|
||||
shared-key: linux-cross-release
|
||||
key: ${{ hashFiles('Cross.toml', 'build/cross/Dockerfile.*') }}
|
||||
cache-all-crates: true
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y unzip xz-utils
|
||||
cargo install cross --locked
|
||||
cargo install cross --version 0.2.5 --locked
|
||||
|
||||
- name: Build frontend
|
||||
working-directory: web
|
||||
|
||||
Reference in New Issue
Block a user