Add sccache and use nextest in our workflow (#265)

* add cache to generic workflow

* add cache to evm workflow

* clean cache and use nextest

* try increasing the cache size

* try 50gb cache size

* add explicit rstfmt as a dependency
This commit is contained in:
Gustavo Gonzalez
2024-07-30 17:15:14 -04:00
committed by GitHub
parent 592c3b694d
commit d14851cc47
2 changed files with 40 additions and 4 deletions
+20 -2
View File
@@ -29,6 +29,10 @@ env:
WASM_BUILD_CLEAN_TARGET: 1
# stripping symbols and optimizing for binary size
RUSTFLAGS: -C strip=symbols -C opt-level=s
# Enable sscache
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "50GB"
jobs:
evm-clippy-fmt-test:
@@ -52,6 +56,9 @@ jobs:
- name: git checkout
uses: actions/checkout@v4
- name: Run sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
with:
@@ -59,27 +66,37 @@ jobs:
- name: install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Install toml-sort
run: cargo install --git https://github.com/4meta5/toml_sort
- name: Add file permissions for toml-sort
run: chmod +x ./scripts/toml-sort.sh
- name: Add file permissions for check-toml-sorted
run: chmod +x ./scripts/check-toml-sorted.sh
- name: Check Cargo.toml files are formatted using toml_sort
run: ./scripts/check-toml-sorted.sh
- name: Check format
run: cargo fmt --all -- --check
- name: "Install nextest"
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Run tests
run: cargo test --release
run: cargo nextest run --release
- name: Check benchmarking compilation
run: cargo check --release --features runtime-benchmarks
- name: Run tests with async backing
run: cargo test --release --features="async-backing"
run: cargo nextest run --release --features="async-backing"
- name: Check clippy
run: cargo clippy --release --locked --all-targets -- -D warnings
@@ -89,6 +106,7 @@ jobs:
env:
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"
# FIXME: Calculate coverage and define how to upload all template coverage reports
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
+20 -2
View File
@@ -29,6 +29,10 @@ env:
WASM_BUILD_CLEAN_TARGET: 1
# stripping symbols and optimizing for binary size
RUSTFLAGS: -C strip=symbols -C opt-level=s
# Enable sscache
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "50GB"
jobs:
clippy-fmt-test:
@@ -52,6 +56,9 @@ jobs:
- name: git checkout
uses: actions/checkout@v4
- name: Run sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
with:
@@ -59,27 +66,37 @@ jobs:
- name: install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Install toml-sort
run: cargo install --git https://github.com/4meta5/toml_sort
- name: Add file permissions for toml-sort
run: chmod +x ./scripts/toml-sort.sh
- name: Add file permissions for check-toml-sorted
run: chmod +x ./scripts/check-toml-sorted.sh
- name: Check Cargo.toml files are formatted using toml_sort
run: ./scripts/check-toml-sorted.sh
- name: "Install nextest"
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Check format
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test --release
run: cargo nextest run --release
- name: Check benchmarking compilation
run: cargo check --release --features runtime-benchmarks
- name: Run tests with async backing
run: cargo test --release --features="async-backing"
run: cargo nextest run --release --features="async-backing"
- name: Check clippy
run: cargo clippy --release --locked --all-targets -- -D warnings
@@ -89,6 +106,7 @@ jobs:
env:
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"
# FIXME: Calculate coverage and define how to upload all template coverage reports
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env: