diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml new file mode 100644 index 000000000..be188d042 --- /dev/null +++ b/.github/actions/setup-rust/action.yml @@ -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 + diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6b4580f66..e882f604a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -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