From 9284f840d92377ceccd5a32b2957149b74d3753f Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:18:55 +0530 Subject: [PATCH 1/5] ci(caches): use rust-cache instead of buildjet to cache deps --- .github/workflows/ci.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ca3d379b5a..d350f8b0ac5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: with: toolchain: ${{ env.RUST_VERSION_FMT }} components: rustfmt + - uses: Swatinem/rust-cache@v2 - name: Rustfmt check run: cargo +${{ env.RUST_VERSION_FMT }} fmt --all -- --check @@ -164,20 +165,12 @@ jobs: toolchain: ${{ env.RUST_VERSION }} targets: "wasm32-unknown-unknown" components: "clippy" + - uses: Swatinem/rust-cache@v2 - name: Install Cargo Make uses: davidB/rust-cargo-make@v1 with: version: "0.36.4" - uses: rui314/setup-mold@v1 - - uses: buildjet/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.command }}-${{ matrix.args }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: actions-rs/cargo@v1 if: ${{ matrix.command == 'nextest' }} with: @@ -231,16 +224,8 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUST_VERSION }} + - uses: Swatinem/rust-cache@v2 - uses: rui314/setup-mold@v1 - - uses: buildjet/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: cargo-test-kms-${{ hashFiles('**/Cargo.lock') }} - name: Run integration tests for kms only run: cargo test -p fuel-core-tests --features aws-kms -- kms @@ -286,6 +271,7 @@ jobs: with: toolchain: ${{ env.RUST_VERSION }} targets: "wasm32-unknown-unknown" + - uses: Swatinem/rust-cache@v2 - name: Publish crate uses: FuelLabs/publish-crates@v1 @@ -371,6 +357,8 @@ jobs: toolchain: ${{ env.RUST_VERSION }} target: ${{ matrix.job.target }},"wasm32-unknown-unknown" + - uses: Swatinem/rust-cache@v2 + - name: Install cross uses: baptiste0928/cargo-install@v1 with: From 320ffd09bcdba4704f743ca063b800ca82843609 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:06:30 +0530 Subject: [PATCH 2/5] fix: use nextest recommended action --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d350f8b0ac5..bd697b923cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,12 +171,7 @@ jobs: with: version: "0.36.4" - uses: rui314/setup-mold@v1 - - uses: actions-rs/cargo@v1 - if: ${{ matrix.command == 'nextest' }} - with: - command: install - args: cargo-nextest --locked - continue-on-error: true + - uses: taiki-e/install-action@nextest - name: ${{ matrix.command }} ${{ matrix.args }} run: ${{ matrix.env }} cargo ${{ matrix.command }} ${{ matrix.args }} - uses: FuelLabs/.github/.github/actions/slack-notify-template@master From ec8edd618a90e478cd4a618507f43e853462dc60 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:11:11 +0530 Subject: [PATCH 3/5] fix: clean titles for test matrix --- .github/workflows/ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd697b923cf..8c613be19e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,48 +111,66 @@ jobs: include: - command: clippy args: -p fuel-core-wasm-executor --target wasm32-unknown-unknown --no-default-features + name: "Clippy wasm-executor" - command: clippy args: --all-targets --all-features + name: "Clippy all" - command: check args: --all-targets + name: "Check all-targets" - command: doc args: --all-features --workspace --no-deps + name: "Doc all" - command: make args: check --locked + name: "Cargo Make check" - command: nextest args: run --workspace + name: "Nextest all" - command: nextest args: run --all-features --workspace + name: "Nextest all-features" - command: nextest args: run -p fuel-core --no-default-features + name: "Nextest fuel-core" - command: nextest args: run -p fuel-core --lib executor --features wasm-executor + name: "Nextest wasm-executor" env: FUEL_ALWAYS_USE_WASM=true - command: nextest args: run -p fuel-core-client --no-default-features + name: "Nextest fuel-core-client" - command: nextest args: run -p fuel-core-chain-config --no-default-features + name: "Nextest fuel-core-chain-config" # Don't split this command; this is a workaround. # We need to run `cargo check` first to fetch the locked dependencies # for `fuel-core 0.26.0`(because of the bug with `--offline` # and `--locked` when we build `fuel-core-wasm-executor 0.26.0`). - command: check args: --manifest-path version-compatibility/Cargo.toml --workspace && cargo test --manifest-path version-compatibility/Cargo.toml --workspace + name: "Check version-compatibility" - command: build args: -p fuel-core-bin --no-default-features --features production + name: "Build fuel-core-bin" # WASM compatibility checks - command: check args: -p fuel-core-types --target wasm32-unknown-unknown --no-default-features --features alloc + name: "Check fuel-core-types wasm" - command: check args: -p fuel-core-storage --target wasm32-unknown-unknown --no-default-features --features alloc + name: "Check fuel-core-storage wasm" - command: check args: -p fuel-core-client --target wasm32-unknown-unknown --no-default-features + name: "Check fuel-core-client wasm" - command: check args: -p fuel-core-chain-config --target wasm32-unknown-unknown --no-default-features + name: "Check fuel-core-chain-config wasm" - command: check args: -p fuel-core-executor --target wasm32-unknown-unknown --no-default-features --features alloc + name: "Check fuel-core-executor wasm" fail-fast: false # disallow any job that takes longer than 45 minutes @@ -172,7 +190,7 @@ jobs: version: "0.36.4" - uses: rui314/setup-mold@v1 - uses: taiki-e/install-action@nextest - - name: ${{ matrix.command }} ${{ matrix.args }} + - name: ${{ matrix.name }} run: ${{ matrix.env }} cargo ${{ matrix.command }} ${{ matrix.args }} - uses: FuelLabs/.github/.github/actions/slack-notify-template@master if: always() && github.ref == 'refs/heads/master' From 47a1727297a0c400f4dd4dd0d88b2474001b1046 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:17:21 +0530 Subject: [PATCH 4/5] test: locked deps --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c613be19e2..8c02f880468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: args: --all-features --workspace --no-deps name: "Doc all" - command: make - args: check --locked + args: check name: "Cargo Make check" - command: nextest args: run --workspace @@ -149,7 +149,7 @@ jobs: # for `fuel-core 0.26.0`(because of the bug with `--offline` # and `--locked` when we build `fuel-core-wasm-executor 0.26.0`). - command: check - args: --manifest-path version-compatibility/Cargo.toml --workspace && cargo test --manifest-path version-compatibility/Cargo.toml --workspace + args: --manifest-path version-compatibility/Cargo.toml --workspace && cargo nextest --manifest-path version-compatibility/Cargo.toml --workspace name: "Check version-compatibility" - command: build args: -p fuel-core-bin --no-default-features --features production @@ -191,7 +191,7 @@ jobs: - uses: rui314/setup-mold@v1 - uses: taiki-e/install-action@nextest - name: ${{ matrix.name }} - run: ${{ matrix.env }} cargo ${{ matrix.command }} ${{ matrix.args }} + run: ${{ matrix.env }} cargo ${{ matrix.command }} ${{ matrix.args }} --locked - uses: FuelLabs/.github/.github/actions/slack-notify-template@master if: always() && github.ref == 'refs/heads/master' with: From 6b0209e5c9a19cece4948b304432a8d4b5d3c5db Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:29:35 +0530 Subject: [PATCH 5/5] fix: use cargo test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c02f880468..fe40f97ada7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: # for `fuel-core 0.26.0`(because of the bug with `--offline` # and `--locked` when we build `fuel-core-wasm-executor 0.26.0`). - command: check - args: --manifest-path version-compatibility/Cargo.toml --workspace && cargo nextest --manifest-path version-compatibility/Cargo.toml --workspace + args: --manifest-path version-compatibility/Cargo.toml --workspace && cargo test --manifest-path version-compatibility/Cargo.toml --workspace name: "Check version-compatibility" - command: build args: -p fuel-core-bin --no-default-features --features production