Skip to content

Commit

Permalink
fixup! chore(CI): split cargo clippy and test into 2 job
Browse files Browse the repository at this point in the history
  • Loading branch information
Flouse committed Oct 18, 2023
1 parent 2f037c4 commit d40173a
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit d40173a

Please sign in to comment.