Skip to content

Commit

Permalink
Cache rust builds and add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert committed Sep 28, 2023
1 parent a578436 commit 73b8c5c
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,8 +14,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Checkout
uses: actions/checkout@v4

- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Build
run: cargo build

- name: Run tests
run: cargo test

- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings

0 comments on commit 73b8c5c

Please sign in to comment.