forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 18
59 lines (59 loc) · 2.31 KB
/
target_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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: ~/actions-runner/_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 }}