Skip to content
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

ci(caches): use rust-cache instead of buildjet to cache deps #2543

Closed
wants to merge 5 commits into from
Closed
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
55 changes: 28 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -110,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
args: check
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
Expand All @@ -164,28 +183,15 @@ 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:
command: install
args: cargo-nextest --locked
continue-on-error: true
- name: ${{ matrix.command }} ${{ matrix.args }}
run: ${{ matrix.env }} cargo ${{ matrix.command }} ${{ matrix.args }}
- uses: taiki-e/install-action@nextest
- name: ${{ matrix.name }}
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:
Expand Down Expand Up @@ -231,16 +237,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

Expand Down Expand Up @@ -286,6 +284,7 @@ jobs:
with:
toolchain: ${{ env.RUST_VERSION }}
targets: "wasm32-unknown-unknown"
- uses: Swatinem/rust-cache@v2

- name: Publish crate
uses: FuelLabs/publish-crates@v1
Expand Down Expand Up @@ -371,6 +370,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:
Expand Down
Loading