add test lint and format as dependencies to the publish job

This commit is contained in:
Anton Suprunchuk
2021-10-09 21:29:47 +03:00
parent d93061f8fb
commit dadf4a291d

View File

@@ -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 }}