mirror of
https://github.com/tonarino/innernet.git
synced 2026-04-26 20:02:40 +02:00
f2ca8c188f
* CI add cargo docs job Per https://github.com/dtolnay/cargo-docs-rs Follow-up to #383 so the we keep docs green. * Run on each workspace member * Skip bin-only crates
101 lines
2.8 KiB
YAML
101 lines
2.8 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
tags-ignore:
|
|
- "v*"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- name: Install Dependencies (if Ubuntu)
|
|
env:
|
|
ACCEPT_EULA: Y
|
|
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-19-dev
|
|
if: contains(runner.os, 'Linux')
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Build
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --workspace --locked --verbose
|
|
- name: Test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --workspace --locked --verbose
|
|
- name: Test (IPv6)
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --workspace --locked --features v6-test --verbose
|
|
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly
|
|
override: true
|
|
components: rustfmt
|
|
- name: Rustfmt
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
- name: Clippy
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: --workspace --locked --all-targets -- -D warnings
|
|
|
|
doc:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
- uses: dtolnay/install@cargo-docs-rs
|
|
- name: Install System Dependencies
|
|
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-19-dev
|
|
- name: Run cargo docs-rs on all workspace members
|
|
run: |
|
|
# cargo metadata lists workspace members, jq filters them to ones that are libraries (as
|
|
# cargo docs-rs fails on bin/only crates) and extracts their names.
|
|
for pkg in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select([.targets[].kind[]] | join(" ") | test("lib|proc-macro")) | .name'); do
|
|
echo "::group::Building docs for $pkg"
|
|
cargo docs-rs -p "$pkg"
|
|
echo "::endgroup::"
|
|
done
|