Skip to content

Run tests on targets #12

Run tests on targets

Run tests on targets #12

Workflow file for this run

name: target-tests
run-name: Run tests on targets
on: [push]
jobs:
test-boards:
strategy:
fail-fast: false
matrix:
target:
# - MBED_TARGET: LPC1768
- MBED_TARGET: NUCLEO_L452RE_P
# - MBED_TARGET: NUCLEO_H743ZI2
# - MBED_TARGET: ARDUINO_NANO33BLE_SWD
- MBED_TARGET: NUCLEO_F429ZI
# - MBED_TARGET: NUCLEO_F767ZI
# - MBED_TARGET: NUCLEO_H723ZG
runs-on: ${{ matrix.target.MBED_TARGET }}
env:
BUILD_DIR: /home/victor/runner-shared/build_${{ matrix.target.MBED_TARGET }}
JUNIT_OUTPUT: ${{ github.workspace }}/mbed-tests-${{ matrix.target.MBED_TARGET }}.xml
steps:
- uses: actions/checkout@v4
- name: Create build directory
run: mkdir -p "$BUILD_DIR"
- name: Set build variables
run: |
echo "MBED_GREENTEA_SERIAL_PORT=$(jq -r --arg RUNNER_NAME ${{ runner.name }} '.[$RUNNER_NAME].MBED_GREENTEA_SERIAL_PORT' runners/runner_configuration.json)" >> $GITHUB_ENV
echo "UPLOAD_METHOD=$(jq -r --arg RUNNER_NAME ${{ runner.name }} '.[$RUNNER_NAME].UPLOAD_METHOD' runners/runner_configuration.json)" >> $GITHUB_ENV
echo "OPENOCD_ADAPTER_SERIAL=$(jq -r --arg RUNNER_NAME ${{ runner.name }} '.[$RUNNER_NAME].OPENOCD_ADAPTER_SERIAL' runners/runner_configuration.json)" >> $GITHUB_ENV
- name: Configure cmake
run: >
- cd "$BUILD_DIR" &&
cmake
${{ github.workspace }}
-GNinja
-DCMAKE_BUILD_TYPE=Develop
-DMBED_TARGET=${{ matrix.target.MBED_TARGET }}
-DMBED_BUILD_GREENTEA_TESTS=ON
-DMBED_GREENTEA_SERIAL_PORT="$MBED_GREENTEA_SERIAL_PORT"
-DUPLOAD_METHOD="$UPLOAD_METHOD"
-DOPENOCD_ADAPTER_SERIAL="$OPENOCD_ADAPTER_SERIAL"
- name: Compile
run: cd "$BUILD_DIR" && ninja
- name: Run ctest
run: >
cd "$BUILD_DIR" &&
ctest
--repeat until-pass:3
--output-on-failure
--output-junit "$JUNIT_OUTPUT"
--test-output-size-passed 100000
--test-output-size-failed 100000
.
- name: Archive ctest results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.target.MBED_TARGET }}
path: ${{ env.JUNIT_OUTPUT }}