-
Notifications
You must be signed in to change notification settings - Fork 939
62 lines (55 loc) · 1.71 KB
/
test-exercises.yml
File metadata and controls
62 lines (55 loc) · 1.71 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
# SPDX-FileCopyrightText: 2026 An Nguyen
#
# SPDX-License-Identifier: Apache-2.0
name: P4 Tutorials CI
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
# Add concurrency so only most recent push have CI
concurrency:
group: p4-tutorials-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify-licenses:
runs-on: ubuntu-latest
name: Validate that all files have copyright and license info
steps:
- uses: actions/checkout@v6
- name: Install REUSE
run: |
./CI/setup-uv.sh
uv pip install reuse
- name: Validate presence of copyright and license info (python w/reuse)
run: |
uv run reuse lint
test-exercise:
timeout-minutes: 30
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
strategy:
matrix:
exercise: [basic, basic_tunnel] # Add more exercises here for future tests
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-dev
pip3 install protobuf==3.20.3 grpcio grpcio-tools googleapis-common-protos scapy
- name: Run PTF Tests
run: |
cd exercises/${{ matrix.exercise }}
make test
# Retain logs in case runs fail
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: p4-logs-${{ matrix.exercise }}
path: exercises/${{ matrix.exercise }}/logs/