Skip to content

Commit

Permalink
adding clippy and rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
k3yavi committed Aug 5, 2020
1 parent 8aa0395 commit aff914f
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,74 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:

Formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt

- name: Check format
run: cargo fmt -- --check

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy

- name: Lint with clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

Coverage:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Install cargo-tarpaulin
uses: actions-rs/install@v0.1
with:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true

- name: Coverage with tarpaulin
run: cargo tarpaulin --all --all-features --timeout 600 --out Lcov -- --test-threads 1

- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info

0 comments on commit aff914f

Please sign in to comment.