-
Notifications
You must be signed in to change notification settings - Fork 42
130 lines (119 loc) · 4.01 KB
/
ci.yaml
File metadata and controls
130 lines (119 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
fmt:
name: Code Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: "rustfmt --check"
run: |
if ! cargo fmt --all --check; then
printf "Please run \`cargo fmt --all\` locally to fix formatting errors.\nSee CONTRIBUTING.md for more details.\n" >&2
exit 1
fi
clippy_check:
name: Lint Check (Clippy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
with:
components: clippy
- name: Install Protocol Buffers Compiler
run: sudo apt-get install -y protobuf-compiler
- name: Set PROTOC Environment Variable
run: export PROTOC=/path/to/protoc
- name: Run Clippy
run: cargo clippy
- name: Run Clippy
run: cargo clippy --package holo-tools
tests_and_coverage_report:
name: Tests and Coverage Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --codecov --output-path codecov.json -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-utils -p holo-vrrp
- name: Upload to Codecov
uses: codecov/codecov-action@v4
if: github.ref == 'refs/heads/master' && github.repository_owner == 'holo-routing'
with:
files: ./lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
tests_arm:
name: Tests (Arm64)
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
- name: Run tests
run: cargo test --all-features -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-utils -p holo-vrrp
fuzz-build-check:
name: Fuzz Targets Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# cargo-fuzz requires nightly Rust due to LLVM sanitizer support
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2025-10-10
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Check fuzz targets
run: cargo fuzz check
bench-build-check:
name: Benchmark Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
- name: Check benchmark builds
run: cargo bench --no-run -p holo-bgp -p holo-ldp -p holo-ospf
spell-check:
name: Spell check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91
- name: Install cargo-spellcheck
uses: taiki-e/install-action@v2
with:
tool: cargo-spellcheck
- name: Run cargo-spellcheck
run: cargo spellcheck --code 1
docker-build-holod:
name: "Docker Build: holod"
uses: ./.github/workflows/docker-build-and-attest.yml
if: github.ref == 'refs/heads/master' && github.repository_owner == 'holo-routing'
with:
image-name: holod
dockerfile: docker/Dockerfile.holod
permissions:
id-token: write
attestations: write
packages: write
docker-build-holo-bundle:
name: "Docker Build: holo-bundle"
needs: docker-build-holod
uses: ./.github/workflows/docker-build-and-attest.yml
if: github.ref == 'refs/heads/master' && github.repository_owner == 'holo-routing'
with:
image-name: holo-bundle
dockerfile: docker/Dockerfile.holo-bundle
permissions:
id-token: write
attestations: write
packages: write