github.com/osrg/gobgp/v3@v3.30.0/.github/workflows/ci.yml (about) 1 name: ci 2 3 on: [push, pull_request] 4 5 jobs: 6 crossbuild: 7 name: crossbuild 8 strategy: 9 matrix: 10 GOOS: ['freebsd', 'openbsd', 'darwin', 'windows'] 11 GOARCH: ['amd64'] 12 runs-on: ubuntu-22.04 13 steps: 14 - uses: actions/checkout@v3 15 - uses: actions/setup-go@v4 16 with: 17 go-version: 'stable' 18 - run: | 19 go env 20 go build ./cmd/gobgp 21 go build ./cmd/gobgpd 22 env: 23 GOOS: ${{ matrix.GOOS }} 24 GOARCH: ${{ matrix.GOARCH }} 25 26 unit: 27 name: unit 28 runs-on: ubuntu-22.04 29 steps: 30 - uses: actions/checkout@v3 31 - uses: actions/setup-go@v4 32 with: 33 go-version: 'stable' 34 - run: | 35 go test -race -timeout 240s ./... 36 if [ "$(go env GOARCH)" = "amd64" ]; then go test -race github.com/osrg/gobgp/v3/pkg/packet/bgp -run ^Test_RaceCondition$; else echo 'skip'; fi 37 38 unit386: 39 name: unit386 40 runs-on: ubuntu-22.04 41 env: 42 GOARCH: 386 43 steps: 44 - uses: actions/checkout@v3 45 - uses: actions/setup-go@v4 46 with: 47 go-version: 'stable' 48 - run: | 49 go env GOARCH 50 go test -timeout 240s ./... 51 52 golangci: 53 name: lint 54 runs-on: ubuntu-22.04 55 steps: 56 - uses: actions/checkout@v3 57 - uses: actions/setup-go@v4 58 with: 59 go-version: 'stable' 60 - name: golangci-lint 61 uses: golangci/golangci-lint-action@v3 62 63 embeded: 64 name: embeded 65 runs-on: ubuntu-22.04 66 steps: 67 - uses: actions/checkout@v3 68 - uses: actions/setup-go@v4 69 with: 70 go-version: 'stable' 71 - run: | 72 python test/scenario_test/ci-scripts/build_embeded_go.py docs/sources/lib.md 73 python test/scenario_test/ci-scripts/build_embeded_go.py docs/sources/lib-ls.md 74 75 lintdoc: 76 name: lintdoc 77 runs-on: ubuntu-22.04 78 steps: 79 - uses: actions/checkout@v3 80 - run: | 81 npm install markdownlint-cli 82 ./node_modules/.bin/markdownlint $(find . -type d -name 'node_modules' -prune -o -type f -name '*.md' -print) 83 sudo apt-get install python3-setuptools 84 sudo pip3 install scspell3k 85 tools/spell-check/scspell.sh 86 tools/grep_avoided_functions.sh 87 88 build: 89 name: build container image 90 runs-on: ubuntu-22.04 91 steps: 92 - uses: actions/checkout@v3 93 - uses: actions/setup-go@v4 94 with: 95 go-version: 'stable' 96 - name: container image 97 run: | 98 sudo apt-get install python3-setuptools 99 sudo pip3 install -r test/pip-requires.txt 100 fab -r test/lib make-gobgp-ctn --tag gobgp --from-image osrg/quagga 101 docker save gobgp > gobgp.tar 102 fab -r test/lib make-gobgp-ctn --tag gobgp-oq --from-image osrg/quagga:v1.0 103 docker save gobgp-oq > gobgp-oq.tar 104 105 - name: upload image file 106 uses: actions/upload-artifact@v3 107 with: 108 name: artifact 109 path: | 110 gobgp.tar 111 gobgp-oq.tar 112 113 router: 114 name: router 115 runs-on: ubuntu-22.04 116 needs: build 117 steps: 118 - uses: actions/checkout@v3 119 - uses: actions/download-artifact@v3 120 - name: test 121 run: | 122 docker load < artifact/gobgp.tar 123 sudo apt-get install python3-setuptools 124 sudo pip3 install -r test/pip-requires.txt 125 PYTHONPATH=test python3 test/scenario_test/bgp_router_test.py --gobgp-image gobgp -x -s 126 127 evpn: 128 name: evpn 129 runs-on: ubuntu-22.04 130 needs: build 131 steps: 132 - uses: actions/checkout@v3 133 - uses: actions/download-artifact@v3 134 - name: test 135 run: | 136 docker load < artifact/gobgp.tar 137 sudo apt-get install python3-setuptools 138 sudo pip3 install -r test/pip-requires.txt 139 PYTHONPATH=test python3 test/scenario_test/evpn_test.py --gobgp-image gobgp -x -s 140 141 flowspec: 142 name: flowspec 143 runs-on: ubuntu-22.04 144 needs: build 145 steps: 146 - uses: actions/checkout@v3 147 - uses: actions/download-artifact@v3 148 - name: test 149 run: | 150 docker load < artifact/gobgp.tar 151 sudo apt-get install python3-setuptools 152 sudo pip3 install -r test/pip-requires.txt 153 PYTHONPATH=test python3 test/scenario_test/flow_spec_test.py --gobgp-image gobgp -x -s 154 155 global-policy: 156 name: global-policy 157 runs-on: ubuntu-22.04 158 needs: build 159 steps: 160 - uses: actions/checkout@v3 161 - uses: actions/download-artifact@v3 162 - name: test 163 run: | 164 docker load < artifact/gobgp.tar 165 sudo apt-get install python3-setuptools 166 sudo pip3 install -r test/pip-requires.txt 167 PYTHONPATH=test python3 test/scenario_test/global_policy_test.py --gobgp-image gobgp -x -s 168 169 graceful-restart: 170 name: graceful-restart 171 runs-on: ubuntu-22.04 172 needs: build 173 steps: 174 - uses: actions/checkout@v3 175 - uses: actions/download-artifact@v3 176 - name: test 177 run: | 178 docker load < artifact/gobgp.tar 179 sudo apt-get install python3-setuptools 180 sudo pip3 install -r test/pip-requires.txt 181 PYTHONPATH=test python3 test/scenario_test/graceful_restart_test.py --gobgp-image gobgp -x -s 182 183 ibgp: 184 name: ibgp 185 runs-on: ubuntu-22.04 186 needs: build 187 steps: 188 - uses: actions/checkout@v3 189 - uses: actions/download-artifact@v3 190 - name: test 191 run: | 192 docker load < artifact/gobgp.tar 193 sudo apt-get install python3-setuptools 194 sudo pip3 install -r test/pip-requires.txt 195 PYTHONPATH=test python3 test/scenario_test/ibgp_router_test.py --gobgp-image gobgp -x -s 196 197 rr: 198 name: route-refector 199 runs-on: ubuntu-22.04 200 needs: build 201 steps: 202 - uses: actions/checkout@v3 203 - uses: actions/download-artifact@v3 204 - name: test 205 run: | 206 docker load < artifact/gobgp.tar 207 sudo apt-get install python3-setuptools 208 sudo pip3 install -r test/pip-requires.txt 209 PYTHONPATH=test python3 test/scenario_test/route_reflector_test.py --gobgp-image gobgp -x -s 210 211 as2: 212 name: as2 213 runs-on: ubuntu-22.04 214 needs: build 215 steps: 216 - uses: actions/checkout@v3 217 - uses: actions/download-artifact@v3 218 - name: test 219 run: | 220 docker load < artifact/gobgp.tar 221 sudo apt-get install python3-setuptools 222 sudo pip3 install -r test/pip-requires.txt 223 PYTHONPATH=test python3 test/scenario_test/route_server_as2_test.py --gobgp-image gobgp -x -s 224 225 ipv4-v6: 226 name: ipv4-v6 227 runs-on: ubuntu-22.04 228 needs: build 229 steps: 230 - uses: actions/checkout@v3 231 - uses: actions/download-artifact@v3 232 - name: test 233 run: | 234 echo "{\"ipv6\": true,\"fixed-cidr-v6\": \"2001:db8:1::/64\"}" > daemon.json 235 sudo cp daemon.json /etc/docker 236 sudo systemctl restart docker 237 docker load < artifact/gobgp.tar 238 sudo apt-get install python3-setuptools 239 sudo pip3 install -r test/pip-requires.txt 240 PYTHONPATH=test python3 test/scenario_test/route_server_ipv4_v6_test.py --gobgp-image gobgp -x -s 241 242 malformed: 243 name: malformed 244 runs-on: ubuntu-22.04 245 needs: build 246 steps: 247 - uses: actions/checkout@v3 248 - uses: actions/download-artifact@v3 249 - name: test 250 run: | 251 docker load < artifact/gobgp.tar 252 sudo apt-get install python3-setuptools 253 sudo pip3 install -r test/pip-requires.txt 254 PYTHONPATH=test python3 test/scenario_test/route_server_malformed_test.py --gobgp-image gobgp -x -s 255 256 rs-policy-grpc: 257 name: rs-policy-grpc 258 runs-on: ubuntu-22.04 259 needs: build 260 steps: 261 - uses: actions/checkout@v3 262 - uses: actions/download-artifact@v3 263 - name: test 264 run: | 265 docker load < artifact/gobgp.tar 266 sudo apt-get install python3-setuptools 267 sudo pip3 install -r test/pip-requires.txt 268 PYTHONPATH=test python3 test/scenario_test/route_server_policy_grpc_test.py --gobgp-image gobgp -x -s 269 270 rs-policy: 271 name: rs-policy 272 runs-on: ubuntu-22.04 273 needs: build 274 steps: 275 - uses: actions/checkout@v3 276 - uses: actions/download-artifact@v3 277 - name: test 278 run: | 279 docker load < artifact/gobgp.tar 280 sudo apt-get install python3-setuptools 281 sudo pip3 install -r test/pip-requires.txt 282 PYTHONPATH=test python3 test/scenario_test/route_server_policy_test.py --gobgp-image gobgp -x -s 283 284 softreset: 285 name: softreset 286 runs-on: ubuntu-22.04 287 needs: build 288 steps: 289 - uses: actions/checkout@v3 290 - uses: actions/download-artifact@v3 291 - name: test 292 run: | 293 docker load < artifact/gobgp.tar 294 sudo apt-get install python3-setuptools 295 sudo pip3 install -r test/pip-requires.txt 296 PYTHONPATH=test python3 test/scenario_test/route_server_softreset_test.py --gobgp-image gobgp -x -s 297 298 rs1: 299 name: routeserver1 300 runs-on: ubuntu-22.04 301 needs: build 302 steps: 303 - uses: actions/checkout@v3 304 - uses: actions/download-artifact@v3 305 - name: test 306 run: | 307 docker load < artifact/gobgp.tar 308 sudo apt-get install python3-setuptools 309 sudo pip3 install -r test/pip-requires.txt 310 PYTHONPATH=test python3 test/scenario_test/route_server_test.py --gobgp-image gobgp -x -s 311 312 rs2: 313 name: routeserver2 314 runs-on: ubuntu-22.04 315 needs: build 316 steps: 317 - uses: actions/checkout@v3 318 - uses: actions/download-artifact@v3 319 - name: test 320 run: | 321 docker load < artifact/gobgp.tar 322 sudo apt-get install python3-setuptools 323 sudo pip3 install -r test/pip-requires.txt 324 PYTHONPATH=test python3 test/scenario_test/route_server_test2.py --gobgp-image gobgp -x -s 325 326 llgr: 327 name: llgr 328 runs-on: ubuntu-22.04 329 needs: build 330 steps: 331 - uses: actions/checkout@v3 332 - uses: actions/download-artifact@v3 333 - name: test 334 run: | 335 docker load < artifact/gobgp.tar 336 sudo apt-get install python3-setuptools 337 sudo pip3 install -r test/pip-requires.txt 338 PYTHONPATH=test python3 test/scenario_test/long_lived_graceful_restart_test.py --gobgp-image gobgp -x -s 339 340 vrf-neighbor1: 341 name: vrf-neighbor1 342 runs-on: ubuntu-22.04 343 needs: build 344 steps: 345 - uses: actions/checkout@v3 346 - uses: actions/download-artifact@v3 347 - name: test 348 run: | 349 docker load < artifact/gobgp.tar 350 sudo apt-get install python3-setuptools 351 sudo pip3 install -r test/pip-requires.txt 352 PYTHONPATH=test python3 test/scenario_test/vrf_neighbor_test.py --gobgp-image gobgp -x -s 353 354 vrf-neighbor2: 355 name: vrf-neighbor2 356 runs-on: ubuntu-22.04 357 needs: build 358 steps: 359 - uses: actions/checkout@v3 360 - uses: actions/download-artifact@v3 361 - name: test 362 run: | 363 docker load < artifact/gobgp.tar 364 sudo apt-get install python3-setuptools 365 sudo pip3 install -r test/pip-requires.txt 366 PYTHONPATH=test python3 test/scenario_test/vrf_neighbor_test2.py --gobgp-image gobgp -x -s 367 368 rtc: 369 name: rtc 370 runs-on: ubuntu-22.04 371 needs: build 372 steps: 373 - uses: actions/checkout@v3 374 - uses: actions/download-artifact@v3 375 - name: test 376 run: | 377 docker load < artifact/gobgp.tar 378 sudo apt-get install python3-setuptools 379 sudo pip3 install -r test/pip-requires.txt 380 PYTHONPATH=test python3 test/scenario_test/rtc_test.py --gobgp-image gobgp -x -s 381 382 unnumbered: 383 name: unnumbered 384 runs-on: ubuntu-22.04 385 needs: build 386 steps: 387 - uses: actions/checkout@v3 388 - uses: actions/download-artifact@v3 389 - name: test 390 run: | 391 echo "{\"ipv6\": true,\"fixed-cidr-v6\": \"2001:db8:1::/64\"}" > daemon.json 392 sudo cp daemon.json /etc/docker 393 sudo systemctl restart docker 394 # don't assign ipv6 addresss to docker0 bridge so two containers have p2p link. 395 sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 396 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 397 sudo sysctl -w net.ipv6.conf.docker0.disable_ipv6=1 398 docker load < artifact/gobgp.tar 399 sudo apt-get install python3-setuptools 400 sudo pip3 install -r test/pip-requires.txt 401 PYTHONPATH=test python3 test/scenario_test/bgp_unnumbered_test.py --gobgp-image gobgp -x -s 402 403 aspath: 404 name: aspath 405 runs-on: ubuntu-22.04 406 needs: build 407 steps: 408 - uses: actions/checkout@v3 409 - uses: actions/download-artifact@v3 410 - name: test 411 run: | 412 docker load < artifact/gobgp.tar 413 sudo apt-get install python3-setuptools 414 sudo pip3 install -r test/pip-requires.txt 415 PYTHONPATH=test python3 test/scenario_test/aspath_test.py --gobgp-image gobgp -x -s 416 417 addpath: 418 name: addpath 419 runs-on: ubuntu-22.04 420 needs: build 421 steps: 422 - uses: actions/checkout@v3 423 - uses: actions/download-artifact@v3 424 - name: test 425 run: | 426 docker load < artifact/gobgp.tar 427 sudo apt-get install python3-setuptools 428 sudo pip3 install -r test/pip-requires.txt 429 PYTHONPATH=test python3 test/scenario_test/addpath_test.py --gobgp-image gobgp -x -s 430 431 malformed-handling: 432 name: malformed-handling 433 runs-on: ubuntu-22.04 434 needs: build 435 steps: 436 - uses: actions/checkout@v3 437 - uses: actions/download-artifact@v3 438 - name: test 439 run: | 440 docker load < artifact/gobgp.tar 441 sudo apt-get install python3-setuptools 442 sudo pip3 install -r test/pip-requires.txt 443 PYTHONPATH=test python3 test/scenario_test/bgp_malformed_msg_handling_test.py --gobgp-image gobgp -x -s 444 445 confederation: 446 name: confederation 447 runs-on: ubuntu-22.04 448 needs: build 449 steps: 450 - uses: actions/checkout@v3 451 - uses: actions/download-artifact@v3 452 - name: test 453 run: | 454 docker load < artifact/gobgp.tar 455 sudo apt-get install python3-setuptools 456 sudo pip3 install -r test/pip-requires.txt 457 PYTHONPATH=test python3 test/scenario_test/bgp_confederation_test.py --gobgp-image gobgp -x -s 458 459 zebra: 460 name: zebra 461 runs-on: ubuntu-22.04 462 needs: build 463 steps: 464 - uses: actions/checkout@v3 465 - uses: actions/download-artifact@v3 466 - name: test 467 run: | 468 docker load < artifact/gobgp.tar 469 sudo apt-get install python3-setuptools 470 sudo pip3 install -r test/pip-requires.txt 471 PYTHONPATH=test python3 test/scenario_test/bgp_zebra_test.py --gobgp-image gobgp -x -s 472 473 zebra-nht: 474 name: zebra-nht 475 runs-on: ubuntu-22.04 476 needs: build 477 steps: 478 - uses: actions/checkout@v3 479 - uses: actions/download-artifact@v3 480 - name: test 481 run: | 482 docker load < artifact/gobgp-oq.tar 483 sudo apt-get install python3-setuptools 484 sudo pip3 install -r test/pip-requires.txt 485 PYTHONPATH=test python3 test/scenario_test/bgp_zebra_nht_test.py --gobgp-image gobgp-oq -x -s 486 487 zapi-v3: 488 name: zapi-v3 489 runs-on: ubuntu-22.04 490 needs: build 491 steps: 492 - uses: actions/checkout@v3 493 - uses: actions/download-artifact@v3 494 - name: test 495 run: | 496 docker load < artifact/gobgp-oq.tar 497 sudo apt-get install python3-setuptools 498 sudo pip3 install -r test/pip-requires.txt 499 PYTHONPATH=test python3 test/scenario_test/zapi_v3_test.py --gobgp-image gobgp-oq -x -s 500 501 zapi-v3-multipath: 502 name: zapi-v3-multipath 503 runs-on: ubuntu-22.04 504 needs: build 505 steps: 506 - uses: actions/checkout@v3 507 - uses: actions/download-artifact@v3 508 - name: test 509 run: | 510 docker load < artifact/gobgp-oq.tar 511 sudo apt-get install python3-setuptools 512 sudo pip3 install -r test/pip-requires.txt 513 PYTHONPATH=test python3 test/scenario_test/zapi_v3_multipath_test.py --gobgp-image gobgp-oq -x -s 514 515 mup: 516 name: mup 517 runs-on: ubuntu-22.04 518 needs: build 519 steps: 520 - uses: actions/checkout@v3 521 - uses: actions/download-artifact@v3 522 - name: test 523 run: | 524 docker load < artifact/gobgp.tar 525 sudo apt-get install python3-setuptools 526 sudo pip3 install -r test/pip-requires.txt 527 PYTHONPATH=test python3 test/scenario_test/mup_test.py --gobgp-image gobgp -x -s 528