From 922cc935eba0313aadf10debf4b777609f674024 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 13 Jan 2024 17:25:41 +0000 Subject: [PATCH] ci: add cache-workspaces test --- .github/workflows/ci.yml | 17 +++++++++++++++++ test-workspace/Cargo.lock | 16 ++++++++++++++++ test-workspace/Cargo.toml | 9 +++++++++ test-workspace/src/main.rs | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 test-workspace/Cargo.lock create mode 100644 test-workspace/Cargo.toml create mode 100644 test-workspace/src/main.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 521e3f6..96ea814 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,3 +70,20 @@ jobs: - run: cargo add serde_as - run: cargo clippy + + cache: + name: Cache + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - id: toolchain + name: Install Rust + uses: ./ + with: + components: clippy + cache: true + cache-workspaces: |- + ./test-workspace + + - run: cargo clippy diff --git a/test-workspace/Cargo.lock b/test-workspace/Cargo.lock new file mode 100644 index 0000000..f0ff31f --- /dev/null +++ b/test-workspace/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ci" +version = "0.1.0" +dependencies = [ + "serde_as", +] + +[[package]] +name = "serde_as" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee4afe4c5c3b69699c4267ae42b838e911466d7ca0005046adc93ac95bb16dd" diff --git a/test-workspace/Cargo.toml b/test-workspace/Cargo.toml new file mode 100644 index 0000000..431b03d --- /dev/null +++ b/test-workspace/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "ci" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde_as = "0.0.1" diff --git a/test-workspace/src/main.rs b/test-workspace/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/test-workspace/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}