The documentation moves from READMEs into a site in docs/: getting started, a user guide, operations, a reference, and development pages, written in the style of network vendors' documentation (docs/STYLE.md). bin/bgp/README.md and docs/RFCs.md are folded into it. - A theme of its own in the International Typographic Style, in blues, with self-hosted Inter and JetBrains Mono, search over Zola's index, dark mode, and no resources loaded from other hosts. - Example configurations in docs/examples/, shown on the pages and checked with `bgp --check` in CI. - A test that fails when a field of config.proto is missing from the configuration reference. - A CI job that builds the site; Zola fails on broken links and anchors. - A hardened systemd unit, tried under systemd with kernel routes on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
96 lines
3.2 KiB
YAML
96 lines
3.2 KiB
YAML
# Runs on every push and pull request. Gitea Actions reads this file too
|
|
# (it falls back to .github/workflows), so one definition serves both.
|
|
name: ci
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
# Warnings fail the build here, and only here: locally they stay warnings
|
|
# so that work in progress compiles.
|
|
RUSTFLAGS: -D warnings
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
- name: Format
|
|
run: cargo fmt --all -- --check
|
|
- name: Lint
|
|
run: cargo clippy --locked --workspace --all-targets -- -D warnings
|
|
- name: Test
|
|
run: cargo test --locked --workspace
|
|
# A link in the documentation to something that is not there.
|
|
- name: Documentation
|
|
env:
|
|
RUSTDOCFLAGS: -D warnings
|
|
run: cargo doc --locked --workspace --no-deps --document-private-items
|
|
# The examples operators start from, here and in the documentation,
|
|
# through the daemon itself.
|
|
- name: Example configurations
|
|
run: |
|
|
for config in testdata/server.textpb docs/examples/*.textpb; do
|
|
cargo run --locked -p bgp -- --check "$config"
|
|
done
|
|
# The tests that change a kernel's routes, in a network namespace of
|
|
# their own; and two daemons that route for each other.
|
|
- name: Kernel tests
|
|
run: scripts/kernel-tests.sh
|
|
|
|
# The documentation site. Zola fails the build on a link to a page or an
|
|
# anchor that is not there.
|
|
docs:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
ZOLA_VERSION: "0.22.1"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Zola
|
|
run: |
|
|
curl -sSfL "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
|
|
| sudo tar -xz -C /usr/local/bin zola
|
|
- name: Build
|
|
run: zola --root docs build
|
|
|
|
# The daemon against FRR, BIRD and Routinator; see
|
|
# docs/content/docs/development/testing.md.
|
|
interop:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Install FRR, BIRD and Routinator
|
|
run: scripts/interop/install.sh
|
|
- name: Build
|
|
run: cargo build --release --locked -p bgp
|
|
- name: Interoperability lab
|
|
run: scripts/interop/lab.sh
|
|
|
|
# A short run of each fuzz target: enough to notice a parser change that
|
|
# breaks on input the seeds are close to. Long runs are done by hand; see
|
|
# fuzz/README.md.
|
|
fuzz:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@nightly
|
|
- name: Install cargo-fuzz
|
|
run: cargo install cargo-fuzz --locked
|
|
- name: Fuzz
|
|
working-directory: fuzz
|
|
# cargo-fuzz sets its own flags; the workspace's -D warnings would
|
|
# replace them.
|
|
env:
|
|
RUSTFLAGS: ""
|
|
run: |
|
|
for target in message message_body attrs prefix_text config rtr netlink; do
|
|
mkdir -p "corpus/$target"
|
|
cargo fuzz run "$target" "corpus/$target" "seeds/$target" -- -max_total_time=60
|
|
done
|