Run tests on targets #4
This file contains 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: target-tests | |
run-name: Run tests on targets | |
on: [push] | |
jobs: | |
test-boards: | |
strategy: | |
matrix: | |
target: | |
# - MBED_TARGET: LPC1768 | |
# UPLOAD_METHOD: OPENOCD | |
# MBED_GREENTEA_SERIAL_PORT: /dev/ttyLPC1768 | |
# OPENOCD_ADAPTER_SERIAL: 10102fa5c13a566eac31a28051fd06540eb7 | |
- MBED_TARGET: NUCLEO_L452RE_P | |
UPLOAD_METHOD: OPENOCD | |
MBED_GREENTEA_SERIAL_PORT: /dev/ttyNUCLEO_L452RE_P | |
OPENOCD_ADAPTER_SERIAL: 066CFF515055657867071915 | |
- MBED_TARGET: NUCLEO_H743ZI2 | |
UPLOAD_METHOD: OPENOCD | |
MBED_GREENTEA_SERIAL_PORT: /dev/ttyNUCLEO_H743ZI2 | |
OPENOCD_ADAPTER_SERIAL: 003C00193438510234313939 | |
- MBED_TARGET: ARDUINO_NANO33BLE_SWD | |
UPLOAD_METHOD: OPENOCD | |
MBED_GREENTEA_SERIAL_PORT: /dev/ttyARDUINO_NANO33BLE_SWD | |
OPENOCD_ADAPTER_SERIAL: "102836021851096100000000000000000000000097969902" | |
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: 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=${{ matrix.target.MBED_GREENTEA_SERIAL_PORT }} | |
-DUPLOAD_METHOD=${{ matrix.target.UPLOAD_METHOD }} | |
-DOPENOCD_ADAPTER_SERIAL=${{ matrix.target.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 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: "$JUNIT_OUTPUT" |