From d52712d044ad62e1789c225ebee9ba1f41ebab0a Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 3 Nov 2024 17:33:03 -0700 Subject: [PATCH] Add logic to disable lint checks and build diem-forge package (#28) * Add logic to disable lint checks since they fail at present * Add build for diem-forge package --- .github/workflows/build.yaml | 5 +++-- .github/workflows/lint.yaml | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 59aa7021ec0..d70674f1bc9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,6 +29,7 @@ jobs: # TODO: check if we need all the packages below -- this list comes from the Libra build setup script packages: build-essential lld pkg-config libssl-dev libgmp-dev clang version: 1.0 # This is a cache key -- change it when you change the package list above - - name: Run cargo build + - name: Run cargo build for default packages run: cargo build - + - name: Run cargo build for diem-forge package + run: cargo build -p diem-forge diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 23a50232cc1..ced49e90269 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,6 +12,7 @@ on: env: ENABLE_RUSTFMT: False + ENABLE_CLIPPY: False jobs: lint-checks: @@ -46,12 +47,16 @@ jobs: # TODO: check if we need all the packages below -- this list comes from the Libra build setup script packages: build-essential lld pkg-config libssl-dev libgmp-dev clang version: 1.0 # This is a cache key -- change it when you change the package list above - - name: Run cargo fmt + - name: Run cargo fmt on default packages if: env.ENABLE_RUSTFMT == 'True' # Note the hacky +nightly below run: cargo +nightly fmt --all -- --check - - name: Run cargo fmt + - name: Skip cargo fmt on default packages if: env.ENABLE_RUSTFMT != 'True' run: echo "cargo fmt skipped due to project code not complying with current format rules" - - name: Run cargo clippy + - name: Run cargo clippy on default packages + if: env.ENABLE_CLIPPY == 'True' run: cargo clippy --workspace --tests -- -D warnings + - name: Skip cargo clippy on default packages + if: env.ENABLE_CLIPPY != 'True' + run: echo "cargo fmt skipped due to project code not complying with current clippy rules"