From 714d2267e8dafd8dfc68d3e1932926e141850517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Tue, 16 Jan 2024 09:30:25 +0000 Subject: [PATCH] GHA: use separate runner for every board MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit split test on hw for every board to speed up tests Signed-off-by: Robert Gałat --- .github/workflows/DUT_tests.yml | 23 +++++++++++----------- .github/workflows/common-build_and_run.yml | 6 ++++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/DUT_tests.yml b/.github/workflows/DUT_tests.yml index f32f91c35f..537613de7d 100644 --- a/.github/workflows/DUT_tests.yml +++ b/.github/workflows/DUT_tests.yml @@ -15,6 +15,10 @@ on: description: "" type: number required: true + target_board: + description: "target board for tests" + type: string + required: true run_tests: description: "" required: false @@ -68,24 +72,23 @@ jobs: - name: Build test artifacts run: | source /workdir/zephyr/zephyr-env.sh - west twister --testsuite-root /workdir/sidewalk/tests --shuffle-tests --shuffle-tests-seed 123 --filter runnable -P native_posix -P unit_testing --inline-logs --overflow-as-errors -vvv --prep-artifacts-for-testing --package-artifacts PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 --subset ${{ inputs.subset }}/${{ inputs.max_subsets }} + west twister --platform ${{inputs.target_board}} --testsuite-root /workdir/sidewalk/tests --filter runnable --shuffle-tests --shuffle-tests-seed 123 --inline-logs --overflow-as-errors -vvv --prep-artifacts-for-testing --package-artifacts PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 --subset ${{ inputs.subset }}/${{ inputs.max_subsets }} - name: save build artifacts uses: actions/cache@v3 with: path: PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 - key: DUT_artifacts_${{ inputs.subset }}_${{ github.sha }} + key: DUT_artifacts_${{inputs.target_board}}_${{ inputs.subset }}_${{ github.sha }} run_dut_ut: needs: [build_tests] if: ${{ fromJson(inputs.run_tests) }} continue-on-error: true - runs-on: test-node + runs-on: [self-hosted, linux, x64, "${{inputs.target_board}}"] container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 --privileged volumes: - - /home/tester/hw_settings:/hw_settings - /dev:/dev - /run/udev:/run/udev defaults: @@ -98,10 +101,6 @@ jobs: with: path: sidewalk - - name: check hw_settings - run: | - ls -lah /hw_settings - - name: Install Python dependencies run: | python3 -m pip install -r sidewalk/scripts/ci/requirements.txt @@ -111,7 +110,7 @@ jobs: id: cache with: path: PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 - key: DUT_artifacts_${{ inputs.subset }}_${{ github.sha }} + key: DUT_artifacts_${{inputs.target_board}}_${{ inputs.subset }}_${{ github.sha }} fail-on-cache-miss: true - name: Fail on missing artifacts @@ -126,11 +125,11 @@ jobs: - name: Run Tests run: | source /workdir/zephyr/zephyr-env.sh - west twister --no-clean -vvv --inline-logs --test-only --hardware-map /hw_settings/hardware_map.yaml --device-testing -T /workdir/sidewalk/tests --retry-failed 2 --west-flash="--recover,--erase" + west twister --no-clean -vvv --inline-logs --test-only --hardware-map /__w/hardware_map.yaml --device-testing -T /workdir/sidewalk/tests --retry-failed 2 --west-flash="--recover,--erase" - name: rename_twister_xml_report run: | - mv twister-out/twister.xml twister-out/${{ inputs.subset }}_twister.xml + mv twister-out/twister.xml twister-out/${{inputs.target_board}}_${{ inputs.subset }}_twister.xml - name: Upload test results uses: actions/upload-artifact@v3 @@ -138,6 +137,6 @@ jobs: with: name: tests-dut_result path: | - twister-out/${{ inputs.subset }}_twister.xml + twister-out/${{inputs.target_board}}_${{ inputs.subset }}_twister.xml twister-out/**/handler.log twister-out/**/device.log diff --git a/.github/workflows/common-build_and_run.yml b/.github/workflows/common-build_and_run.yml index 9d45102fea..92e6a9ddc3 100644 --- a/.github/workflows/common-build_and_run.yml +++ b/.github/workflows/common-build_and_run.yml @@ -179,13 +179,15 @@ jobs: strategy: fail-fast: true matrix: - subset: [1, 2, 3, 4] + subset: [1, 2, 3] + board: ${{ fromJson(inputs.supported_platforms) }} uses: ./.github/workflows/DUT_tests.yml with: change_nrf_revision: ${{ inputs.change_nrf_revision }} subset: ${{ matrix.subset }} - max_subsets: 4 + max_subsets: 3 run_tests: true + target_board: ${{ matrix.board }} build_and_run_ut_x86: runs-on: ubuntu-latest