Skip to content

Commit

Permalink
👷 (ci): Create ci workflow
Browse files Browse the repository at this point in the history
semver: chore
  • Loading branch information
Somfic committed May 25, 2024
1 parent 36b78f1 commit 134a0e0
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
workflow_call:
inputs:
rust-version:
type: string
required: false
default: nightly

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ inputs.rust-version }}
override: true
components: rustfmt, clippy

- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
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: Lint
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Install cargo check tools
run: |
cargo install --locked cargo-deny || true
cargo install --locked cargo-outdated || true
cargo install --locked cargo-udeps || true
cargo install --locked cargo-audit || true
cargo install --locked cargo-pants || true
- name: Check
run: |
cargo deny check
cargo outdated --exit-code 1
cargo udeps
rm -rf ~/.cargo/advisory-db
cargo audit
cargo pants
- name: Test
run: cargo test

0 comments on commit 134a0e0

Please sign in to comment.