From 8539eed549bd007c8f2481c124b77841b2b9ffe5 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Tue, 11 Jan 2022 22:08:31 +0800 Subject: [PATCH] add rustup lint and clippy --- .github/workflows/test.yaml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fcee4e4..c1851ec 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,11 @@ # under the License. name: Python test -on: [push, pull_request] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: test: @@ -30,19 +34,27 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Rust toolchain - run: | - rustup toolchain install stable - rustup default stable - rustup component add rustfmt - - name: Cache Cargo uses: actions/cache@v2 with: path: /home/runner/.cargo key: cargo-maturin-cache-${{ hashFiles('Cargo.lock') }} - - uses: actions/setup-python@v2 + - name: Setup Rust Toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: default + override: true + + - name: Cargo Clippy + run: cargo clippy + + - name: Cargo Check + run: cargo check --all --frozen --locked + + - name: Setup Python Toolchain + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }}