From 990ffb9b4fe21f1574b206e0704e8f0ef079d808 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sat, 17 Dec 2022 20:11:21 +0800 Subject: [PATCH] separates clippy check to clippy-check workflow --- .github/workflows/build-and-test.yml | 30 ------------------- .github/workflows/clippy-check.yml | 43 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/clippy-check.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 58f0cf56a245..2e0ca2e25adb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -28,7 +28,6 @@ jobs: with: toolchain: stable profile: minimal - components: clippy default: true override: true - name: Build & Test (Default) @@ -47,32 +46,3 @@ jobs: run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-2022" - name: Build with All Features Enabled - shadowsocks run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-2022" - - name: Clippy Check - uses: actions-rs/clippy-check@v1 - with: - name: clippy-${{ matrix.platform }} - token: ${{ secrets.GITHUB_TOKEN }} - args: | - --features "local-http-rustls local-redir local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-2022" -- -Z macro-backtrace - -W clippy::absurd_extreme_comparisons - -W clippy::erasing_op - -A clippy::collapsible_else_if - # - name: prepare AppleSilicon build - # uses: actions-rs/toolchain@v1 - # with: - # target: aarch64-apple-darwin - # toolchain: nightly - # if: runner.os == 'macOS' - - # # https://github.com/actions/virtual-environments/issues/2557#issuecomment-769611326 - # - if: runner.os == 'macOS' - # run: | - # sudo xcode-select -s /Applications/Xcode_12.4.app && - # sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* - - # - name: Check compilation for Apple Silicon - # uses: actions-rs/cargo@v1 - # with: - # command: check - # args: --target aarch64-apple-darwin - # if: runner.os == 'macOS' diff --git a/.github/workflows/clippy-check.yml b/.github/workflows/clippy-check.yml new file mode 100644 index 000000000000..ae75442a55a4 --- /dev/null +++ b/.github/workflows/clippy-check.yml @@ -0,0 +1,43 @@ +name: Clippy Check + +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + CARGO_TERM_COLOR: always + RUST_LOG: "trace" + +jobs: + clippy-check: + strategy: + matrix: + platform: + - ubuntu-latest + - windows-latest + - macos-latest + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + profile: minimal + components: clippy + default: true + override: true + - name: Clippy Check + uses: actions-rs/clippy-check@v1 + with: + name: clippy-${{ matrix.platform }} + token: ${{ secrets.GITHUB_TOKEN }} + args: | + --features "local-http-rustls local-redir local-flow-stat local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-2022" -- -Z macro-backtrace + -W clippy::absurd_extreme_comparisons + -W clippy::erasing_op + -A clippy::collapsible_else_if