Skip to content

Commit

Permalink
Small tweaks to make CI faster (#1050)
Browse files Browse the repository at this point in the history
* Reduce # of feature combinations to check

* Try and make CI faster

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

* Increase hack timeout

* Fix native feature gating in sov-vec-setter

Signed-off-by: Filippo Costa <filippo@sovlabs.io>

* Fix sov-ledger-rpc features for tests

---------

Signed-off-by: Filippo Costa <filippo@sovlabs.io>
  • Loading branch information
neysofu authored Oct 17, 2023
1 parent e08ca49 commit 32bc691
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
54 changes: 26 additions & 28 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
run: rustup show && rustup install nightly && rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu # Nightly is needed for our configuration of cargo fmt
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
shared-key: cargo-check
shared-key: cargo-check-cache
save-if: ${{ github.ref == 'refs/heads/nightly' }}
workspaces: |
.
fuzz
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- name: Run lint
run: |
if ! make lint ; then
Expand All @@ -102,7 +102,7 @@ jobs:
# effectively.
needs: check
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 60
timeout-minutes: 120
env:
SKIP_GUEST_BUILD: "1"
steps:
Expand All @@ -120,7 +120,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
shared-key: cargo-check
shared-key: cargo-check-cache
save-if: ${{ github.ref == 'refs/heads/nightly' }}
workspaces: |
.
Expand All @@ -140,18 +140,18 @@ jobs:
with:
version: "23.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
# `cargo-nextest` is much faster than standard `cargo test`.
- uses: taiki-e/install-action@nextest
- name: Install Rust
run: rustup show
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
save-if: ${{ github.ref == 'refs/heads/nightly' }}
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- run: cargo nextest run --workspace --all-features
test:
name: test
Expand All @@ -167,14 +167,14 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
save-if: ${{ github.ref == 'refs/heads/nightly' }}
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
# `cargo-nextest` does not support doctests (yet?), so we have to run them
# separately.
# TODO: https://github.com/nextest-rs/nextest/issues/16
Expand All @@ -195,10 +195,6 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- name: add llvm component
run: rustup component add llvm-tools-preview
- name: cargo install cargo-llvm-cov
Expand All @@ -207,6 +203,10 @@ jobs:
with:
cache-provider: "buildjet"
save-if: ${{ github.ref == 'refs/heads/nightly' }}
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
Expand All @@ -233,8 +233,7 @@ jobs:
steps:
- uses: actions/checkout@v3
# Not sure installing `mold` is actually needed, but it's what the
# `check` job does and their caches are shared, so it's best to keep
# things as similar as possible.
# `check` job, and we'd rather keep things as similar as possible.
- uses: rui314/setup-mold@v1
- name: Install Protoc
uses: arduino/setup-protoc@v2
Expand All @@ -246,7 +245,6 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
shared-key: cargo-doc
save-if: ${{ github.ref == 'refs/heads/nightly' }}
# The docs' artifact tends to become quite large with all the
# dependencies, so we don't include them.
Expand Down Expand Up @@ -308,14 +306,14 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
run: rustup show
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- uses: Swatinem/rust-cache@v2
with:
cache-provider: "buildjet"
save-if: ${{ github.ref == 'refs/heads/nightly' }}
- name: Install cargo-risc0 # Risc0 v0.17 and higher require a cargo extension to build the guest code
run: cargo install cargo-risczero
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install
- name: Compile README.md to Bash
run: cargo run --bin bashtestmd -- --input examples/demo-rollup/README.md --output demo-rollup-readme.sh --tag test-ci
- run: cat demo-rollup-readme.sh
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ lint-fix: ## cargo fmt, fix and clippy. Skip clippy on guest code since it's no
SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty

check-features: ## Checks that project compiles with all combinations of features.
cargo hack check --workspace --feature-powerset --exclude-features --all-targets
cargo hack check --workspace --feature-powerset --exclude-features default --all-targets

check-fuzz: ## Checks that fuzz member compiles
$(MAKE) -C fuzz check
Expand Down
1 change: 1 addition & 0 deletions full-node/sov-ledger-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tempfile = "3"
serde_json = "1"
sov-db = { path = "../../full-node/db/sov-db" }
tokio = { workspace = true, features = ["full"] }
sov-ledger-rpc = { path = ".", features = ["client", "server"] }

[features]
default = ["client", "server"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ publish = false

[dev-dependencies]
sov-value-setter = { path = ".", features = ["native"] }
sov-modules-api = { path = "../../../sov-modules-api", features = ["native"] }
tempfile = { workspace = true }

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resolver = "2"
publish = false

[dev-dependencies]
sov-modules-api = { path = "../../../sov-modules-api" }
sov-modules-api = { path = "../../../sov-modules-api", features = ["native", "macros"] }
tempfile = { workspace = true }

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fn test_cases() -> Vec<(Address, CallMessage, Option<Vec<u32>>)> {
}

#[test]
#[cfg(feature = "native")]
fn test_vec_setter_calls() {
let tmpdir = tempfile::tempdir().unwrap();

Expand Down

0 comments on commit 32bc691

Please sign in to comment.