1212permissions :
1313 contents : read
1414jobs :
15+ smoke-check-for-changes :
16+ runs-on : ubuntu-22.04
17+ permissions :
18+ pull-requests : read
19+ outputs :
20+ changed : ${{ steps.filter.outputs.linux_tests == 'true' }}
21+ steps :
22+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
24+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
25+ id : filter
26+ with :
27+ filters : .github/path_filters.yml
28+
1529 run-smoke-tests :
30+ needs : smoke-check-for-changes
31+ if : ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' }}
1632 strategy :
1733 matrix :
1834 nic :
@@ -24,26 +40,31 @@ jobs:
2440 timeout-minutes : 720
2541 steps :
2642 - name : ' preparation: Harden Runner'
43+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
2744 uses : step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
2845 with :
2946 egress-policy : audit
3047 - name : ' preparation: Checkout MTL'
48+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
3149 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3250 with :
3351 ref : ' ${{ github.ref }}'
3452 - uses : ./.github/actions/build
3553 - name : ' installation: Install pipenv environment'
54+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
3655 working-directory : tests/validation
3756 id : pipenv-install
3857 run : |
3958 python3 -m venv .venv
4059 source .venv/bin/activate
4160 pip install -r requirements.txt
4261 - name : Create session ID
62+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
4363 run : |
4464 runner_name=${{ runner.name }}
4565 echo "SESSION_ID=${runner_name##*-}" >> "$GITHUB_ENV"
4666 - name : Set PCI device env variable
67+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
4768 run : |
4869 if [ "${{ matrix.nic }}" = "e810" ]; then
4970 echo "PCI_DEVICE=8086:1592" >> "$GITHUB_ENV"
5374 echo "PCI_DEVICE=8086:12d2" >> "$GITHUB_ENV"
5475 fi
5576 - name : Generate test framework config files
77+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
5678 working-directory : tests/validation/configs
5779 run : |
5880 python3 gen_config.py \
6486 --username ${{ secrets.RUNNER_USERNAME }} \
6587 --key_path ${{ secrets.RUNNER_KEY_PATH }}
6688 - name : ' preparation: Evaluate choosen validation-test-port-p and validation-test-port-r'
89+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
6790 run : |
6891 eval "export TEST_PORT_P=TEST_VF_PORT_P_0"
6992 eval "export TEST_PORT_R=TEST_VF_PORT_P_1"
@@ -72,30 +95,35 @@ jobs:
7295 echo "TEST_PORT_P=${TEST_PORT_P}"
7396 echo "TEST_PORT_R=${TEST_PORT_R}"
7497 - name : ' preparation: Kill MtlManager and pytest routines'
98+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
7599 run : |
76100 sudo killall -SIGINT pipenv || true
77101 sudo killall -SIGINT pytest || true
78102 sudo killall -SIGINT MtlManager || true
79103 - name : ' preparation: Create VFs'
104+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
80105 run : |
81106 sudo rmmod irdma || true
82107 sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
83108 sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true
84109 - name : ' preparation: Start MtlManager at background'
110+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
85111 run : |
86112 sudo MtlManager &
87113 - name : ' execution: Run validation-bare-metal tests in virtual environment'
114+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
88115 run : |
89116 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
90117 - name : " upload report"
118+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
91119 id : upload-report
92120 uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
93121 with :
94122 name : smoke-test-report-${{ matrix.nic }}
95123 path : |
96124 report.html
97125 - name : " Add report to summary"
98- if : always()
126+ if : ${{ needs.smoke-check-for-changes.outputs.changed == 'true' }}
99127 run : |
100128 {
101129 echo "## Smoke Tests Report"
0 commit comments