TCP keepalive #105
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: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
permissions: | |
contents: read | |
jobs: | |
ci-pass: | |
name: CI is green | |
runs-on: ubuntu-latest | |
needs: | |
- style | |
- test | |
- udeps | |
steps: | |
- run: exit 0 | |
style: | |
name: Check Formatting and Style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: cargo fmt --check | |
run: | | |
if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then | |
printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\nSee CONTRIBUTING.md for more details.\n" >&2 | |
exit 1 | |
fi | |
- name: cargo clippy | |
run: cargo clippy | |
test: | |
name: Test ${{ matrix.rust }} on ${{ matrix.os }} | |
needs: | |
- style | |
strategy: | |
matrix: | |
rust: | |
- stable | |
# - beta | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macOS-latest | |
include: | |
- rust: stable | |
# - rust: beta | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust (${{ matrix.rust }}) | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test | |
run: cargo test ${{ matrix.features }} | |
udeps: | |
name: Detect unused dependencies | |
needs: | |
- style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install cargo-udeps | |
uses: taiki-e/install-action@cargo-udeps | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check unused dependencies on default features | |
run: cargo udeps |