Skip to content

Commit 1b10ee2

Browse files
authored
ci: enable caching for cargo (#31)
1 parent 70dac93 commit 1b10ee2

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,28 @@ env:
66
CARGO_TERM_COLOR: always
77

88
jobs:
9-
check:
10-
runs-on: ubuntu-latest
11-
name: Check
12-
steps:
13-
- uses: actions/checkout@v3
14-
- name: cargo check
15-
run: cargo check
169
test:
1710
runs-on: ubuntu-latest
18-
name: Test
11+
name: CI
1912
steps:
2013
- uses: actions/checkout@v3
14+
- name: Set up cargo cache
15+
uses: actions/cache@v3
16+
continue-on-error: false
17+
with:
18+
path: |
19+
~/.cargo/bin/
20+
~/.cargo/registry/index/
21+
~/.cargo/registry/cache/
22+
~/.cargo/git/db/
23+
target/
24+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
25+
restore-keys: ${{ runner.os }}-cargo-
2126
- name: cargo test
2227
run: cargo test
23-
# uncomment to enable clippy lints
24-
# clippy:
25-
# runs-on: ubuntu-latest
26-
# name: Lint (clippy)
27-
# steps:
28-
# - uses: actions/checkout@v3
29-
# - name: cargo clippy
30-
# run: cargo clippy -- -D warnings
31-
# uncoment to enable format checking
32-
# fmt:
33-
# runs-on: ubuntu-latest
34-
# name: Format
35-
# steps:
36-
# - uses: actions/checkout@v3
37-
# - name: cargo fmt
38-
# run: cargo fmt --check
28+
# uncomment to enable clippy linter
29+
# - name: cargo clippy
30+
# run: cargo clippy -- -D warnings
31+
# uncomment to enable format linter
32+
# - name: cargo fmt
33+
# run: cargo fmt --check

src/template/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn bench<I: Clone, T>(func: impl Fn(I) -> T, input: I, base_time: &Duration) ->
6969

7070
(
7171
Duration::from_nanos(average_duration(&timers) as u64),
72-
bench_iterations as u128,
72+
bench_iterations,
7373
)
7474
}
7575

0 commit comments

Comments
 (0)