Skip to content

Commit

Permalink
Seperates linting/Rust into linting/{Rust, Rust-Typos, Rust-Audit}
Browse files Browse the repository at this point in the history
Given the nature of using NASL to identify vulnerabilities we may cannot
get rif of all audit findings. To indicate that the CI fails based on an
audit, rather than e.g. a clippy warning, cargo audit is seperated into
an own job.

Since the same may be true for typos, typos are seperated into an own
job as well.

With that change we can immediately see if a CI of a PR failed because
of audit, typos or Rust linting issues.
  • Loading branch information
nichtsfrei committed Nov 11, 2024
1 parent ffa011e commit 1ac1a4f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Setup Rust Environment"
description: "Install necessary dependencies and set up Rust stable"
runs:
using: "composite"
steps:
- run: sudo apt update || true
shell: bash
- run: sudo apt-get install -y libpcap-dev
shell: bash
- run: rustup update stable && rustup default stable || rustup default stable
shell: bash

30 changes: 20 additions & 10 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,25 @@ jobs:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: sudo apt update || true
- run: sudo apt-get install -y libpcap-dev
- run: rustup update stable && rustup default stable || rustup default stable
- run: cargo install cargo-audit
- uses: ./.github/actions/setup-rust
- run: cargo clippy -- -D warnings
- run: cargo fmt --check
Rust-Typos:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust
- run: cargo install typos-cli
- name: Clippy
run: cargo clippy -- -D warnings
- name: Audit
run: cargo audit
- run: typos
- name: Formatting
run: cargo fmt --check
Rust-Audit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: cargo install cargo-audit
- run: cargo audit

0 comments on commit 1ac1a4f

Please sign in to comment.