Skip to content

Commit

Permalink
ci: update audit and format action
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Feb 10, 2025
1 parent 540b094 commit d6c3c6a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
35 changes: 13 additions & 22 deletions .github/workflows/audit-format.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
name: Audit & Format
name: Audit, Format, Clippy
on:
pull_request:
push:
branches:
- main
- develop
- rc/next
- ci/revamp
workflow_dispatch:

# Cancel previous runs for the same workflow
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

env:
RUSTFLAGS: "-Dwarnings"

jobs:
audit:
name: Audit and format
name: Audit, format, clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust toolchain
run: |
rustup set profile minimal
rustup toolchain install stable --component rustfmt
rustup override set stable
uses: actions/checkout@v4

- name: Cache cargo
id: cache-cargo
uses: actions/cache@v4
with:
path: |
Expand All @@ -38,15 +29,15 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-audit-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-audit-${{ env.RUST_VERSION_HASH }}-${{ hashFiles('./Cargo.lock') }}

- name: Install dependencies
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install cargo-audit

# This can only be ran in root dir
- name: Run audit
run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2021-0076 --ignore RUSTSEC-2022-0090 --ignore RUSTSEC-2022-002 --ignore RUSTSEC-2022-0028 --ignore RUSTSEC-2024-0399
run: |
cargo install cargo-audit
cargo audit
- name: Run rustfmt
run: cargo fmt --all -- --check

- name: Run clippy
run: cargo clippy --workspace
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Check contract syntax"
uses: docker://hirosystems/clarinet:latest
with:
Expand Down

0 comments on commit d6c3c6a

Please sign in to comment.