From 88c160a2194a818921e8d5977dba2299e24d4ea4 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sat, 27 Jun 2020 21:27:20 -0400 Subject: [PATCH] Restructure and add clippy check --- .github/workflows/build_test.yml | 46 ++++++++++++++++++++++---------- .github/workflows/deploy.yml | 6 ++--- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 15dd0eb..6e972a0 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -15,24 +15,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: toolchain: stable components: rustfmt - - name: Run rustfmt + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Run rustfmt run: cargo fmt -- --check - check_and_test: - name: Lint and Test + check: + name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy - uses: actions/cache@v2 with: path: | @@ -40,10 +44,24 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo check + run: cargo check + - name: Run clippy + run: cargo clippy + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable - - name: Check - run: cargo check --verbose - - name: Test - run: cargo test --verbose + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Run cargo test + run: cargo test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 67caf7b..b3724a2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,6 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable - uses: actions/cache@v2 with: path: | @@ -17,9 +20,6 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - name: Build release run: cargo build --release - name: Upload binary