Rust #298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ "*" ] | |
schedule: | |
- cron: '13 3 * * 0' | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-Dwarnings" | |
RUSTMSRV: "1.65" | |
jobs: | |
commitlint: | |
runs-on: ubuntu-latest | |
name: Commitlint | |
steps: | |
- name: Conventional Commitlint | |
uses: opensource-nepal/commitlint@v1 | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly toolchain with clippy | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Run Rustfmt | |
run: cargo fmt -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly toolchain with clippy | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- name: Run Clippy | |
run: cargo clippy --all-targets --all-features | |
build: | |
name: Rust Build & Test (Stable) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Run tests (with netns) | |
run: | | |
nft --version | |
cargo --config \ | |
"target.'cfg(target_os = \"linux\")'.runner = 'unshare -rn'" \ | |
test --verbose -- --ignored | |
build-msrv: | |
name: Rust Build (MSRV) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install Rust msrv (${{ env.RUSTMSRV }}) | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUSTMSRV }} | |
- name: Build | |
run: cargo build --verbose |