Skip to content

Commit ce26a8c

Browse files
authored
FIX: Smoke tests workflow run not to fail
FIX: Smoke tests workflow run not to fail FIX: Move python3 dependencies collect methods to nexy stage. ADD: Install pipenv for python3 for easy env management.
1 parent 9168009 commit ce26a8c

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

.github/workflows/smoke-tests.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: smoke-tests-bare-metal
22
on:
3+
workflow_call:
34
workflow_dispatch:
45
push:
56
branches:
@@ -9,18 +10,24 @@ on:
910
branches:
1011
- main
1112
- 'maint-**'
13+
1214
env:
15+
DEBIAN_FRONTEND: noninteractive
1316
BUILD_TYPE: 'Release'
1417
DPDK_VERSION: '25.03'
1518
DPDK_REBUILD: 'false'
19+
1620
permissions:
1721
contents: read
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
25+
cancel-in-progress: true
26+
1827
jobs:
1928
validation-build-mtl:
2029
runs-on: [Linux, self-hosted, DPDK]
2130
timeout-minutes: 60
22-
outputs:
23-
pipenv-activate: ${{ steps.pipenv-install.outputs.VIRTUAL_ENV }}
2431
steps:
2532
- name: 'preparation: Harden Runner'
2633
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
@@ -61,7 +68,7 @@ jobs:
6168
sudo apt-get install -y \
6269
git gcc meson tar zip \
6370
pkg-config \
64-
python3 \
71+
python3-dev \
6572
python3-pyelftools \
6673
python3-virtualenv \
6774
python3-pip \
@@ -112,23 +119,18 @@ jobs:
112119
make -j "$(nproc)"
113120
sudo make install
114121
sudo ldconfig
122+
115123
- name: 'installation: Build GStreamer'
116124
working-directory: ecosystem/gstreamer_plugin
117125
run: |
118126
./build.sh
119-
- name: 'installation: Install pipenv environment'
120-
working-directory: tests/validation
121-
id: pipenv-install
122-
run: |
123-
python3 -m venv venv
124-
source venv/bin/activate
125-
pip install -r requirements.txt
126-
echo "VIRTUAL_ENV=$PWD/venv/bin/activate" >> "$GITHUB_ENV"
127+
127128
validation-run-tests:
128129
needs: [validation-build-mtl]
129130
runs-on: [Linux, self-hosted, DPDK]
130131
timeout-minutes: 720
131132
env:
133+
PIPENV_VENV_IN_PROJECT: '1'
132134
PYTEST_RETRIES: '3'
133135
steps:
134136
- name: 'preparation: Harden Runner'
@@ -153,12 +155,28 @@ jobs:
153155
sudo rmmod irdma || true
154156
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
155157
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true
158+
159+
- name: 'installation: Install pipenv environment'
160+
working-directory: tests/validation
161+
run: |
162+
sudo apt update && \
163+
sudo apt install -y \
164+
python3-dev \
165+
python3-pyelftools \
166+
python3-virtualenv \
167+
python3-pip \
168+
pipenv && \
169+
pipenv install -r requirements.txt
170+
156171
- name: 'preparation: Start MtlManager at background'
157172
run: |
158173
sudo MtlManager &
174+
159175
- name: 'execution: Run validation-bare-metal tests in virtual environment'
176+
working-directory: tests/validation
160177
run: |
161-
sudo tests/validation/venv/bin/python3 -m pytest --topology_config=tests/validation/configs/topology_config.yaml --test_config=tests/validation/configs/test_config.yaml -m smoke --template=html/index.html --report=report.html
178+
sudo pipenv run pytest --topology_config=configs/topology_config.yaml --test_config=configs/test_config.yaml -m smoke --template=html/index.html --report=report.html
179+
162180
- name: "upload report"
163181
id: upload-report
164182
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3

0 commit comments

Comments
 (0)