Skip to content

Commit

Permalink
Add test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Oct 22, 2023
1 parent 1193000 commit 57e4997
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: test

on:
push:
branches:
- master
- release
pull_request:

# This uses the toolchain defined in rust-toolchain
jobs:
fmt:
name: "Rustfmt"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache cargo files
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') }}

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache Rust files
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') }}

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D clippy::all'

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache Rust files
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') }}

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test

0 comments on commit 57e4997

Please sign in to comment.