From d40173a111c004dec14e09b05ee51077afaa229b Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:31:28 +0000 Subject: [PATCH] fixup! chore(CI): split cargo clippy and test into 2 job --- .github/workflows/rust.yml | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7e508704b..65c76963c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,10 +9,6 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install Rust components - run: | - cargo fmt --version || rustup component add rustfmt - cargo clippy --version || rustup component add clippy - name: Cache of Cargo uses: actions/cache@v3 with: @@ -26,8 +22,12 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-cargo-clippy + - name: Install Rust components + run: | + cargo fmt --version || rustup component add rustfmt + cargo clippy --version || rustup component add clippy - name: Check format - run: cargo fmt -- --check + run: cargo fmt --all -- --check --verbose - name: Cargo clippy check env: RUSTFLAGS: -D warnings @@ -40,8 +40,19 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Install moleculec v0.7.2 - run: CARGO_TARGET_DIR=target/ cargo install moleculec --version 0.7.2 + + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-cargo-test - name: Cache of component.gwos-evm id: godwoken-polyjuice-cache @@ -50,26 +61,16 @@ jobs: path: | gwos-evm/build/*generator* gwos-evm/build/*validator* - key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }} + key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }} - name: Build godwoken-polyjuice if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true' working-directory: gwos-evm run: | + test "$(moleculec --version)" = "Moleculec 0.7.2" \ + || cargo install moleculec --version 0.7.2 --force git submodule update --init --recursive --depth=1 make all-via-docker - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-cargo-test - name: Test all targets run: RUST_BACKTRACE=1 cargo test --all-targets