Skip to content

Use caching #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
check:
name: Check the code
name: Check and test the code
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -27,6 +27,10 @@ jobs:
run: |
rustup component add clippy
cargo clippy --all-features -- -D clippy::all -W clippy::cargo -W clippy::pedantic
- name: Run cargo check
run: cargo check --all-features
- name: Run cargo test
run: cargo test --all-features

test:
name: Run tests and measure coverage
Expand All @@ -40,14 +44,24 @@ jobs:
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- uses: actions/checkout@v1
- name: Run tests
run: |
cargo test --all-features
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry
- name: Cache target dir
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('target') }}
restore-keys: |
${{ runner.os }}-cargo-target-
continue-on-error: true
- name: Generate and upload coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
cargo install --force cargo-tarpaulin
env CARGO_TARGET_DIR=~/.cargo/target cargo install --force cargo-tarpaulin
cargo tarpaulin --all-features --out Xml
bash <(curl -s https://codecov.io/bash)
- uses: actions/upload-artifact@master
Expand Down