Update r1.cfg #66
This file contains hidden or 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: Batfish CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'snapshots/ci_net/**/*' | |
| jobs: | |
| batfish-ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Start Batfish (Docker) | |
| run: | | |
| sudo docker run -d --name batfish -p 8888:8888 -p 9996:9996 batfish/allinone | |
| # wait until Batfish API responds | |
| for i in {1..60}; do | |
| if curl -sSf http://localhost:9996/v2/version >/dev/null 2>&1; then | |
| echo "Batfish ready"; break | |
| fi | |
| sleep 1 | |
| done | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pybatfish==2025.7.7.2423 ansible pytest jinja2 | |
| - name: Prepare Batfish snapshot | |
| run: | | |
| sudo mkdir -p snapshots/ci_net/s1/configs/manual | |
| sudo mkdir -p snapshots/ci_net/s1/configs/generated | |
| # for i in {1..5}; do | |
| # sudo touch snapshots/ci_net/s1/router$i.cfg | |
| # echo "! Router $i config" | sudo tee snapshots/ci_net/s1/configs/router$i.cfg >/dev/null | |
| # done | |
| - name: Generate configs from yaml if have | |
| run: python tools/conf-generator.py | |
| - name: Copy configs to snapshot (Ansible) | |
| run: ansible-playbook ansible/playbook.yml -i ansible/hosts | |
| - name: Run Python script | |
| run: python tests/test_batfish.py |