Skip to content

Commit

Permalink
feat: add broader cargo checks - udeps, audit, fmt, clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed Jun 20, 2024
1 parent 49ec2cb commit ab4cf4e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/actions/cargo-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Cargo check'
description: 'Checks cargo with check, deny, format, clippy, udeps and audit.'

inputs:
github_token:
description: 'GitHub token for cargo audit.'
required: true

runs:
using: composite
steps:

- name: Install rustc nightly
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: rustup toolchain install nightly

- name: Cargo deny
uses: EmbarkStudios/cargo-deny-action@v1

- name: Cargo check
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: cargo check --verbose

- name: Cargo format
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: cargo fmt --all -- --check --verbose

- name: Cargo clippy
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: cargo clippy

- name: Cargo udeps
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: |
cargo install cargo-udeps
cargo +nightly udeps --all-targets
- name: Cargo audit
uses: rustsec/[email protected]
with:
token: ${{ inputs.github_token }}

0 comments on commit ab4cf4e

Please sign in to comment.