ci: enable caching for cargo (#31)
This commit is contained in:
parent
70dac9329f
commit
1b10ee20ac
2 changed files with 20 additions and 25 deletions
43
.github/workflows/ci.yml
vendored
43
.github/workflows/ci.yml
vendored
|
@ -6,33 +6,28 @@ env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Check
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: cargo check
|
|
||||||
run: cargo check
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Test
|
name: CI
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up cargo cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
continue-on-error: false
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-cargo-
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test
|
run: cargo test
|
||||||
# uncomment to enable clippy lints
|
# uncomment to enable clippy linter
|
||||||
# clippy:
|
# - name: cargo clippy
|
||||||
# runs-on: ubuntu-latest
|
# run: cargo clippy -- -D warnings
|
||||||
# name: Lint (clippy)
|
# uncomment to enable format linter
|
||||||
# steps:
|
# - name: cargo fmt
|
||||||
# - uses: actions/checkout@v3
|
# run: cargo fmt --check
|
||||||
# - name: cargo clippy
|
|
||||||
# run: cargo clippy -- -D warnings
|
|
||||||
# uncoment to enable format checking
|
|
||||||
# fmt:
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# name: Format
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v3
|
|
||||||
# - name: cargo fmt
|
|
||||||
# run: cargo fmt --check
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ fn bench<I: Clone, T>(func: impl Fn(I) -> T, input: I, base_time: &Duration) ->
|
||||||
|
|
||||||
(
|
(
|
||||||
Duration::from_nanos(average_duration(&timers) as u64),
|
Duration::from_nanos(average_duration(&timers) as u64),
|
||||||
bench_iterations as u128,
|
bench_iterations,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue