mirror of
https://github.com/nftables-rs/nftables-rs.git
synced 2026-10-13 08:01:12 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
78 lines
2.0 KiB
YAML
78 lines
2.0 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
schedule:
|
|
- cron: '13 3 * * 0'
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: "-Dwarnings"
|
|
|
|
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@v6
|
|
- 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@v6
|
|
- name: Install Rust nightly toolchain with clippy
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
components: clippy
|
|
- name: Run Clippy
|
|
run: |
|
|
cargo clippy --all-targets --features tokio
|
|
cargo clippy --all-targets --features async-process
|
|
build:
|
|
name: Rust Build & Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
rust_version:
|
|
- { name: msrv, version: "1.76" }
|
|
- { name: stable, version: stable }
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v6
|
|
- name: Install Rust ${{ matrix.rust_version.name }} (${{ matrix.rust_version.version }})
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: ${{ matrix.rust_version.version }}
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
- name: Run tests
|
|
run: cargo test --verbose
|
|
- name: Run tests (with netns)
|
|
run: |
|
|
# enable user network ns on runner
|
|
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
|
|
|
nft --version
|
|
cargo --config \
|
|
"target.'cfg(target_os = \"linux\")'.runner = 'unshare -rn'" \
|
|
test --verbose -- --ignored
|