Skip to content

Commit

Permalink
diff clippy and build
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketfuryrocks committed Dec 4, 2023
1 parent 2266c71 commit db939fd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 8 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 2 additions & 8 deletions .github/workflows/test.yml → .github/workflows/clippy_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cargo Build & Test
name: Cargo Nightly Clippy

on:
push:
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit db939fd

Please sign in to comment.