From 853fa8b421bc3c92190f65646df3f7c4754c9245 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 27 Jun 2024 19:34:18 +1000 Subject: [PATCH] Speedup regenerate-target-info and regenerate-windows-sys (#1110) Create lockfile so that rust-cache knows if a new cache needs to be saved. Also enables cache-all-crates since the crates themselves rarely changes. --- .github/workflows/regenerate-target-info.yml | 5 +++++ .github/workflows/regenerate-windows-sys.yml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/regenerate-target-info.yml b/.github/workflows/regenerate-target-info.yml index a9334a57..9d30a4a1 100644 --- a/.github/workflows/regenerate-target-info.yml +++ b/.github/workflows/regenerate-target-info.yml @@ -21,8 +21,13 @@ jobs: - name: Install rust run: | rustup toolchain install stable nightly --no-self-update --profile minimal + + - name: Create lockfile + run: cargo update - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: 'true' - name: Regenerate target info run: cargo run -p gen-target-info diff --git a/.github/workflows/regenerate-windows-sys.yml b/.github/workflows/regenerate-windows-sys.yml index df6695c8..8fabbe30 100644 --- a/.github/workflows/regenerate-windows-sys.yml +++ b/.github/workflows/regenerate-windows-sys.yml @@ -18,7 +18,13 @@ jobs: run: | git checkout -b regenerate-windows-sys-${{ github.run_id }} + - name: Create lockfile + run: cargo update + - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: 'true' + - name: Regenerate windows sys bindings run: cargo run -p gen-windows-sys-binding