Skip to content

Commit

Permalink
GHA: use separate runner for every board
Browse files Browse the repository at this point in the history
split test on hw for every board to speed up tests

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Jan 16, 2024
1 parent 2cc7287 commit 714d226
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/DUT_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -126,18 +125,18 @@ 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
if: always()
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
6 changes: 4 additions & 2 deletions .github/workflows/common-build_and_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 714d226

Please sign in to comment.