Skip to content

Commit 1ac1a4f

Browse files
committed
Seperates linting/Rust into linting/{Rust, Rust-Typos, Rust-Audit}
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.
1 parent ffa011e commit 1ac1a4f

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Setup Rust Environment"
2+
description: "Install necessary dependencies and set up Rust stable"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: sudo apt update || true
7+
shell: bash
8+
- run: sudo apt-get install -y libpcap-dev
9+
shell: bash
10+
- run: rustup update stable && rustup default stable || rustup default stable
11+
shell: bash
12+

.github/workflows/linting.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,25 @@ jobs:
1919
working-directory: rust
2020
steps:
2121
- uses: actions/checkout@v4
22-
- run: sudo apt update || true
23-
- run: sudo apt-get install -y libpcap-dev
24-
- run: rustup update stable && rustup default stable || rustup default stable
25-
- run: cargo install cargo-audit
22+
- uses: ./.github/actions/setup-rust
23+
- run: cargo clippy -- -D warnings
24+
- run: cargo fmt --check
25+
Rust-Typos:
26+
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: rust
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: ./.github/actions/setup-rust
2633
- run: cargo install typos-cli
27-
- name: Clippy
28-
run: cargo clippy -- -D warnings
29-
- name: Audit
30-
run: cargo audit
3134
- run: typos
32-
- name: Formatting
33-
run: cargo fmt --check
35+
Rust-Audit:
36+
runs-on: ubuntu-latest
37+
defaults:
38+
run:
39+
working-directory: rust
40+
steps:
41+
- uses: actions/checkout@v4
42+
- run: cargo install cargo-audit
43+
- run: cargo audit

0 commit comments

Comments
 (0)