Skip to content

Commit

Permalink
Merge pull request #15 from johanhelsing/update-ci
Browse files Browse the repository at this point in the history
Update CI actions, add caching
  • Loading branch information
johanhelsing authored Apr 14, 2023
2 parents e121301 + 1b81a7d commit 8cac303
Showing 1 changed file with 30 additions and 37 deletions.
67 changes: 30 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,56 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Cache
uses: Swatinem/rust-cache@v2

- name: cargo check
run: cargo check --all-targets

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

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Cache
uses: Swatinem/rust-cache@v2

- name: cargo test
run: cargo test

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Cache
uses: Swatinem/rust-cache@v2

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: cargo fmt
run: cargo fmt --all -- --check

- name: cargo clippy
run: cargo clippy -- -D warnings

0 comments on commit 8cac303

Please sign in to comment.