Add PTF tests for basic forwarding exercise # 1 #2
Workflow file for this run
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: P4 Tutorials CI | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| test-basic-exercise: | |
| runs-on: ubuntu-latest | |
| # We use need a privileged container because P4 tests need to create veth interfaces | |
| container: | |
| image: p4lang/p4c:latest | |
| options: --privileged | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install build dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y make python3-pip sudo libboost-iostreams-dev libboost-graph-devs | |
| pip3 install protobuf==3.20.3 grpcio grpcio-tools googleapis-common-protos scapy | |
| - name: Ensure scripts are executable | |
| run: | | |
| chmod +x exercises/basic/runptf.sh | |
| - name: Run PTF Tests | |
| run: | | |
| cd exercises/basic | |
| mkdir -p logs | |
| make test | |
| # Retain logs in case runs fail | |
| - name: Upload Logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: p4-logs | |
| path: exercises/basic/logs/ |