nightly-tests-bare-metal #154
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: nightly-tests-bare-metal | |
| on: | |
| # allow manually trigger | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' # Every day at midnight UTC | |
| permissions: | |
| contents: read | |
| jobs: | |
| run-nightly-tests: | |
| strategy: | |
| matrix: | |
| nic: | |
| - e810 | |
| - e810-dell | |
| - e830 | |
| fail-fast: false | |
| runs-on: ${{ matrix.nic }} | |
| timeout-minutes: 720 | |
| steps: | |
| - name: 'preparation: Harden Runner' | |
| uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2 | |
| with: | |
| egress-policy: audit | |
| - name: 'preparation: Checkout MTL' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: '${{ github.ref }}' | |
| - uses: ./.github/actions/build | |
| - name: 'installation: Install pipenv environment' | |
| working-directory: tests/validation | |
| id: pipenv-install | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| pip install -r requirements.txt | |
| - name: Create session ID | |
| run: | | |
| runner_name=${{ runner.name }} | |
| echo "SESSION_ID=${runner_name##*-}" >> "$GITHUB_ENV" | |
| - name: Set PCI device env variable | |
| run: | | |
| if [ "${{ matrix.nic }}" = "e810" ]; then | |
| echo "PCI_DEVICE=8086:1592" >> "$GITHUB_ENV" | |
| elif [ "${{ matrix.nic }}" = "e810-dell" ]; then | |
| echo "PCI_DEVICE=8086:1592" >> "$GITHUB_ENV" | |
| elif [ "${{ matrix.nic }}" = "e830" ]; then | |
| echo "PCI_DEVICE=8086:12d2" >> "$GITHUB_ENV" | |
| fi | |
| - name: Generate test framework config files | |
| working-directory: tests/validation/configs | |
| run: | | |
| python3 gen_config.py \ | |
| --session_id ${{ env.SESSION_ID }} \ | |
| --build ${{ secrets.RUNNER_BUILD }} \ | |
| --mtl_path ${{ secrets.RUNNER_MTL_PATH }} \ | |
| --pci_device ${{ env.PCI_DEVICE }} \ | |
| --ip_address 127.0.0.1 \ | |
| --username ${{ secrets.RUNNER_USERNAME }} \ | |
| --key_path ${{ secrets.RUNNER_KEY_PATH }} | |
| - name: 'preparation: Evaluate chosen validation-test-port-p and validation-test-port-r' | |
| run: | | |
| eval "export TEST_PORT_P=TEST_VF_PORT_P_0" | |
| eval "export TEST_PORT_R=TEST_VF_PORT_P_1" | |
| echo "TEST_PORT_P=${TEST_PORT_P}" >> "$GITHUB_ENV" | |
| echo "TEST_PORT_R=${TEST_PORT_R}" >> "$GITHUB_ENV" | |
| echo "TEST_PORT_P=${TEST_PORT_P}" | |
| echo "TEST_PORT_R=${TEST_PORT_R}" | |
| - name: 'preparation: Kill MtlManager and pytest routines' | |
| run: | | |
| sudo killall -SIGINT pipenv || true | |
| sudo killall -SIGINT pytest || true | |
| sudo killall -SIGINT MtlManager || true | |
| - name: 'preparation: Create VFs' | |
| run: | | |
| sudo rmmod irdma || true | |
| sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true | |
| sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true | |
| - name: 'preparation: Start MtlManager at background' | |
| run: | | |
| sudo MtlManager & | |
| - name: 'execution: Run nightly-bare-metal tests in virtual environment' | |
| run: | | |
| tests/validation/.venv/bin/python3 -m pytest --topology_config=tests/validation/configs/topology_config.yaml --test_config=tests/validation/configs/test_config.yaml -m nightly --template=html/index.html --report=report.html | |
| - name: run gtest bare metal | |
| if: always() | |
| env: | |
| NIGHTLY: 1 | |
| EXIT_ON_FAILURE: 0 | |
| LOG_FILE: "${{ github.workspace }}/gtest.log" | |
| run: | | |
| sudo -E "${{ github.workspace }}/.github/scripts/gtest.sh" | |
| - name: "upload report python" | |
| if: always() | |
| id: upload-report | |
| uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
| with: | |
| name: nightly-test-report-${{ matrix.nic }} | |
| path: | | |
| report.html | |
| - name: "upload report gtest" | |
| if: always() | |
| id: upload-report-gtest | |
| uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
| with: | |
| name: nightly-gtest-report-${{ matrix.nic }} | |
| path: | | |
| gtest.log |