From dadf4a291d7d2030340cd162eb4a08dc281255ad Mon Sep 17 00:00:00 2001 From: Anton Suprunchuk Date: Sat, 9 Oct 2021 21:29:47 +0300 Subject: [PATCH] add test lint and format as dependencies to the publish job --- .github/workflows/publish.yml | 41 ++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fef2dab..2a5eb71 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: - v* jobs: - publish: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -18,6 +18,45 @@ jobs: override: true - name: Run tests run: cargo test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - name: Install Clippy + run: rustup component add clippy + - name: Run linter + run: cargo clippy -- -D warnings + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - name: Install rustfmt + run: rustup component add rustfmt + - name: Check format + run: cargo fmt --all -- --check + publish: + needs: [test, lint, format] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true - shell: bash env: CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}