From db939fda291dd62a35cfcfcd6cafa0f8ce7e4417 Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Mon, 4 Dec 2023 19:47:48 +0530 Subject: [PATCH] diff clippy and build --- .github/workflows/build_test.yml | 49 +++++++++++++++++++ .../workflows/{test.yml => clippy_test.yml} | 10 +--- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build_test.yml rename .github/workflows/{test.yml => clippy_test.yml} (87%) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 00000000..66635ea6 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,49 @@ +name: Cargo Build & Test + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + SCCACHE_GHA_ENABLED: true + RUSTC_WRAPPER: sccache + SCCACHE_CACHE_SIZE: "1G" + +jobs: + build_and_test: + name: lite-rpc full build + runs-on: ubuntu-22.04 + steps: + - name: Install Linux Packages + run: | + sudo apt-get update -y + sudo apt-get install libssl-dev openssl -y + + - uses: actions/checkout@v4 + + # The toolchain action should definitely be run before the cache action + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache: true + # avoid the default "-D warnings" which thrashes cache + rustflags: "" + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + + # https://github.com/actions/cache/blob/main/examples.md#rust---cargo + # https://blog.arriven.wtf/posts/rust-ci-cache/ + - uses: Swatinem/rust-cache@v2 + with: + # will be covered by sscache + cache-targets: false + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + + - name: Early Build + run: | + cargo build --locked --workspace --all-targets + + - name: Run Tests + run: RUST_LOG=info cargo test diff --git a/.github/workflows/test.yml b/.github/workflows/clippy_test.yml similarity index 87% rename from .github/workflows/test.yml rename to .github/workflows/clippy_test.yml index f1ca8163..0a63ac32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/clippy_test.yml @@ -1,4 +1,4 @@ -name: Cargo Build & Test +name: Cargo Nightly Clippy on: push: @@ -26,6 +26,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: # use toolchain version from rust-toolchain.toml + toolchain: nightly components: rustfmt, clippy cache: true # avoid the default "-D warnings" which thrashes cache @@ -43,14 +44,7 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Early Build - run: | - cargo build --locked --workspace --all-targets - - name: Run fmt+clippy run: | cargo fmt --all --check cargo clippy --locked --workspace --all-targets -- -D warnings - - - name: Run Tests - run: RUST_LOG=info cargo test