CI bsim workflow: Add UART tests to the bsim workflow
Add new workflow steps to the babblesim workflow to run also the UART tests on the nrf52_bsim. This commit: * Enables the single device tests (which we may move to the normal twister workflow once we fix the requirement for a fixture) * Adds as a placeholder the infra for multidevice tests. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
9af74504dd
commit
53c121381f
28
.github/workflows/bsim-tests.yaml
vendored
28
.github/workflows/bsim-tests.yaml
vendored
|
@ -20,6 +20,8 @@ on:
|
|||
- "include/zephyr/net/openthread.h"
|
||||
- "drivers/ieee802154/**"
|
||||
- "include/zephyr/net/ieee802154*"
|
||||
- "drivers/serial/*nrfx*"
|
||||
- "tests/drivers/uart/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
|
||||
|
@ -44,6 +46,7 @@ jobs:
|
|||
bsim_bt_53_test_results_file: ./bsim_bt/53_bsim_results.xml
|
||||
bsim_bt_53split_test_results_file: ./bsim_bt/53_bsim_split_results.xml
|
||||
bsim_net_52_test_results_file: ./bsim_net/52_bsim_results.xml
|
||||
bsim_uart_test_results_file: ./bsim_uart/uart_bsim_results.xml
|
||||
steps:
|
||||
- name: Apply container owner mismatch workaround
|
||||
run: |
|
||||
|
@ -116,10 +119,20 @@ jobs:
|
|||
drivers/ieee802154/**
|
||||
include/zephyr/net/ieee802154*
|
||||
|
||||
- name: Check if UART files changed
|
||||
uses: tj-actions/changed-files@v41
|
||||
id: check-uart-files
|
||||
with:
|
||||
files: |
|
||||
tests/bsim/drivers/uart/**
|
||||
drivers/serial/*nrfx*
|
||||
tests/drivers/uart/**
|
||||
|
||||
- name: Update BabbleSim to manifest revision
|
||||
if: >
|
||||
steps.check-bluetooth-files.outputs.any_changed == 'true'
|
||||
|| steps.check-networking-files.outputs.any_changed == 'true'
|
||||
|| steps.check-uart-files.outputs.any_changed == 'true'
|
||||
|| steps.check-common-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
export BSIM_VERSION=$( west list bsim -f {revision} )
|
||||
|
@ -163,6 +176,18 @@ jobs:
|
|||
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_net_52_test_results_file} \
|
||||
SEARCH_PATH=tests/bsim/net/ tests/bsim/run_parallel.sh
|
||||
|
||||
- name: Run UART Tests with BSIM
|
||||
if: steps.check-uart-files.outputs.any_changed == 'true' || steps.check-common-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
echo "UART: Single device tests"
|
||||
./scripts/twister -T tests/drivers/uart/ --force-color --inline-logs -v -M -p nrf52_bsim \
|
||||
--fixture gpio_loopback -- -uart0_loopback
|
||||
echo "UART: Multi device tests"
|
||||
export ZEPHYR_BASE=${PWD}
|
||||
WORK_DIR=${ZEPHYR_BASE}/bsim_uart nice tests/bsim/drivers/uart/compile.sh
|
||||
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_uart_test_results_file} \
|
||||
SEARCH_PATH=tests/bsim/drivers/uart/ tests/bsim/run_parallel.sh
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -173,6 +198,9 @@ jobs:
|
|||
./bsim_bt/53_bsim_results.xml
|
||||
./bsim_bt/53_bsim_split_results.xml
|
||||
./bsim_net/52_bsim_results.xml
|
||||
./bsim_uart/uart_bsim_results.xml
|
||||
./twister-out/twister.xml
|
||||
./twister-out/twister.json
|
||||
${{ github.event_path }}
|
||||
if-no-files-found: warn
|
||||
|
||||
|
|
26
tests/bsim/drivers/uart/compile.sh
Executable file
26
tests/bsim/drivers/uart/compile.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2023 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Compile all the applications needed by all bsim UART tests
|
||||
|
||||
#set -x #uncomment this line for debugging
|
||||
set -ue
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
|
||||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
|
||||
directory}"
|
||||
|
||||
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
|
||||
|
||||
mkdir -p ${WORK_DIR}
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
# Placeholder, nothing yet
|
||||
# Add apps needed for multidevice UART tests here
|
||||
|
||||
wait_for_background_jobs
|
Loading…
Reference in a new issue