Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add caching and clippy annotations to CI #3518

Merged
merged 1 commit into from
Oct 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
types: [opened, synchronize, reopened]

name: CI

env:
toolchain: nightly-2021-08-18
jobs:
clippy:
name: clippy
Expand All @@ -19,31 +20,41 @@ jobs:
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-08-18
toolchain: ${{ env.toolchain }}
components: clippy, rustfmt
override: true
- name: Caching
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
- name: Clippy check
uses: actions-rs/clippy-check@v1
with:
command: clippy
args: -- -D warnings -W clippy::cognitive_complexity
- name: cargo clippy --all-targets
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
test:
name: test
runs-on: ubuntu-18.04
steps:
- name: checkout
uses: actions/checkout@v2

- name: Caching
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: ubuntu dependencies
if: startsWith(matrix.os,'ubuntu')
run: |
Expand All @@ -64,7 +75,7 @@ jobs:
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-08-18
toolchain: ${{ env.toolchain }}
components: clippy, rustfmt
override: true

Expand Down