Skip to content

Commit 5bd7c4a

Browse files
committed
Update validation-tests.yml
1 parent 2ed979e commit 5bd7c4a

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

.github/workflows/validation-tests.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,46 @@ jobs:
3737
outputs:
3838
pipenv-activate: ${{ steps.pipenv-install.outputs.VIRTUAL_ENV }}
3939
steps:
40-
- name: Harden Runner
40+
- name: 'preparation: Harden Runner'
4141
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
4242
with:
4343
egress-policy: audit
4444

45-
- name: Checkout MTL
45+
- name: 'preparation: Checkout MTL'
4646
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4747
with:
4848
ref: '${{ inputs.branch-to-checkout }}'
4949

50-
- name: Checkout DPDK
50+
- name: 'preparation: Checkout DPDK'
5151
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5252
with:
5353
repository: 'DPDK/dpdk'
5454
ref: 'v${{ env.DPDK_VERSION }}'
5555
path: 'dpdk'
5656

57-
- name: Install the build dependency
57+
- name: 'configuration: Install the build dependency'
5858
run: |
5959
sudo apt-get install -y git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev
6060
sudo apt-get install -y systemtap-sdt-dev
6161
62-
- name: Apply dpdk patches
62+
- name: 'configuration: Apply dpdk patches'
6363
run: |
6464
patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
6565
66-
- name: Build dpdk
66+
- name: 'installation: Build dpdk'
6767
run: |
6868
cd dpdk
6969
meson build
7070
ninja -C build
7171
cd build
7272
sudo ninja install
7373
74-
- name: Build
74+
- name: 'installation: Build mtl'
7575
run: |
7676
./build.sh
7777
sudo ldconfig
7878
79-
- name: Prepare pipenv environment
79+
- name: 'installation: Install pipenv environment'
8080
working-directory: tests/validation
8181
id: pipenv-install
8282
run: |
@@ -90,30 +90,49 @@ jobs:
9090
needs: [validation-build-mtl]
9191
runs-on: [Linux, self-hosted, DPDK]
9292
steps:
93-
- name: Harden Runner
93+
- name: 'preparation: Harden Runner'
9494
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
9595
with:
9696
egress-policy: audit
9797

98-
- name: Kill previous pytest routine
98+
- name: 'preparation: Kill MtlManager and pytest routines'
9999
run: |
100100
sudo killall -SIGINT pipenv || true
101101
sudo killall -SIGINT pytest || true
102102
sudo killall -SIGINT MtlManager || true
103103
104-
- name: Binding network adapter
104+
- name: 'preparation: Binding network adapter'
105105
run: |
106106
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
107107
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci "${TEST_DMA_PORT_P}" || true
108108
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci "${TEST_DMA_PORT_R}" || true
109109
110-
- name: Start MtlManager at background
110+
- name: 'preparation: Start MtlManager at background'
111111
run: |
112112
sudo MtlManager &
113113
114-
- name: Run tests in pipenv environment
114+
- name: 'execution: Run tests in pipenv environment'
115115
working-directory: tests/validation
116116
run: |
117-
echo source "${{ needs.validation-build-mtl.outputs.pipenv-activate }}"
118117
source "$(python3 -m pipenv --venv)/bin/activate"
119-
pytest '${{ inputs.validation-tests }}' --nic="${TEST_PORT_P},${TEST_PORT_R}" --media=/mnt/media --build='../..'
118+
sudo pytest '${{ inputs.validation-tests }}' --nic="${TEST_PORT_P},${TEST_PORT_R}" --media=/mnt/media --build='../..'
119+
120+
validation-cleanup-tests:
121+
needs: [validation-build-mtl, validation-run-tests]
122+
runs-on: [Linux, self-hosted, DPDK]
123+
if: always()
124+
steps:
125+
- name: 'preparation: Harden Runner'
126+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
127+
with:
128+
egress-policy: audit
129+
130+
- name: 'cleanup: Kill MtlManager and pytest routines'
131+
run: |
132+
sudo killall -SIGINT pipenv || true
133+
sudo killall -SIGINT pytest || true
134+
sudo killall -SIGINT MtlManager || true
135+
136+
- name: 'cleanup: Restore valid owner to repository and directories'
137+
run: |
138+
sudo chown -R "${USER}" "$(pwd)"

0 commit comments

Comments
 (0)