Skip to content

Commit

Permalink
Check code for clippy lints and formatting with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
arqunis committed Jan 7, 2021
1 parent 2a0d6d3 commit ae1411b
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copied from Twilight's Lint workflow.
#
# https://github.com/twilight-rs/twilight/blob/trunk/.github/workflows/lint.yml
name: Lint

on: [push, pull_request]

jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-clippy-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --tests

rustfmt:
name: Format
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Run cargo fmt
run: cargo fmt --all -- --check

0 comments on commit ae1411b

Please sign in to comment.