Skip to content

Commit

Permalink
Rust cache tests (#600)
Browse files Browse the repository at this point in the history
* Test github actions cache for rust

* Trigger ci

* Test another cache step

* Trigger ci

* Add cache step

* Back to testing actions/cache

* Trigger ci

* Test path

* Test

* Debug step

* Update rust.yml

* Update bench_pull_request.yml

* Test target without tarpaulin

* Debug

* Don't include lockfiles from targets

* Restrict cache targets to avoid complicated permissions issues

* Include build

* Include incremental build :fingers-crossed:

* Incremental won't work anyway

* Enable codecov

* Clean

* Fix

* Remove spurious separator

* Only cache deps

As explained in Swatinem/rust-cache#37, build artifacts only contribute
to bloating the cache, as the divergences negate any benefits from
caching them due to the cache key not changing over most commits.

Co-authored-by: Juan-M-V <[email protected]>
Co-authored-by: Mario J. Rugiero <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2022
1 parent 42dadd1 commit 2b4de15
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.9'

- 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/debug/deps/
target/release/deps/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install test dependencies
run: pip install ecdsa fastecdsa sympy cairo-lang
- uses: actions/checkout@v3
Expand Down Expand Up @@ -56,6 +71,20 @@ jobs:
run: make clippy
- name: Coverage
run: make coverage
- name: Cache Codecov-report
uses: actions/upload-artifact@master
with:
name: codecov-report
path: target/tarpaulin
upload-codecov:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Retrieve cached report
uses: actions/download-artifact@master
with:
name: codecov-report
path: target/tarpaulin
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
Expand Down

0 comments on commit 2b4de15

Please sign in to comment.