Skip to content

Commit b3995fc

Browse files
authored
Introducing caching for tests job (#834)
* Introducing caching for tests job * Update cargo paths * Remove locked flag
1 parent dd6b909 commit b3995fc

File tree

3 files changed

+7934
-11
lines changed

3 files changed

+7934
-11
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,19 @@ jobs:
4242
- uses: actions/checkout@v4
4343
with:
4444
submodules: true
45+
- name: Cache
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.cargo/bin/
50+
~/.cargo/registry/index/
51+
~/.cargo/registry/cache/
52+
~/.cargo/git/db/
53+
target/
54+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
4555
- name: Install ${{ matrix.toolchain }}
4656
uses: dtolnay/rust-toolchain@stable
4757
with:
4858
toolchain: ${{ matrix.toolchain }}
49-
- name: cargo generate-lockfile
50-
# enable this ci template to run regardless of whether the lockfile is checked in or not
51-
if: hashFiles('Cargo.lock') == ''
52-
run: cargo generate-lockfile
53-
# https://twitter.com/jonhoo/status/1571290371124260865
54-
- name: cargo test --locked
55-
run: cargo test --workspace --locked --all-features --all-targets
59+
- name: cargo test
60+
run: cargo test --workspace --all-features --all-targets

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ debug/
44
target/
55
object_store/
66

7-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
8-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
9-
Cargo.lock
10-
117
# These are backup files generated by rustfmt
128
**/*.rs.bk
139

0 commit comments

Comments
 (0)