Update MP2 dependencies #781
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: Tests | |
on: [push, pull_request] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
RetrieveTargetsMatrix: | |
uses: ./.github/workflows/create-matrix.yml | |
Test-fetch: | |
runs-on: ubuntu-latest | |
needs: RetrieveTargetsMatrix | |
strategy: | |
matrix: ${{ fromJSON(needs.RetrieveTargetsMatrix.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/installToolchain | |
- name: Create build directory for tests/fetch | |
run: cmake -E make_directory ${{ runner.workspace }}/tests/fetch/build | |
- name: Configure tests/fetch | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/fetch/build | |
run: cmake -DTEST_FAMILIES=${{ matrix.family }} $GITHUB_WORKSPACE/tests/fetch/ | |
- name: Create HAL config files from templates | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/fetch/build | |
run: | | |
TEMPLATES=($(find _deps -name "*_template.h")) | |
for template in ${TEMPLATES[@]}; do | |
#get rid off "_template" in file name | |
DEST=$(basename ${template} | sed -rn "s@([^/]*)(_template)(\.h)@\1\3@p") | |
cp ${template} ${DEST} | |
done | |
if: ${{ matrix.family != 'MP2'}} | |
- name: Build tests/fetch | |
working-directory: ${{ runner.workspace }}/tests/fetch/build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE | |
Test-CMSIS: | |
runs-on: ubuntu-latest | |
needs: RetrieveTargetsMatrix | |
strategy: | |
matrix: ${{ fromJSON(needs.RetrieveTargetsMatrix.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/installToolchain | |
- name: Create build directory for tests/cmsis | |
run: cmake -E make_directory ${{ runner.workspace }}/tests/cmsis/build | |
if: ${{ matrix.family != 'MP1' && matrix.family != 'MP2'}} | |
- name: Configure tests/cmsis | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/cmsis/build | |
run: cmake -DTEST_FAMILIES=${{ matrix.family }} -DFETCH_ST_SOURCES=TRUE $GITHUB_WORKSPACE/tests/cmsis/ | |
if: ${{ matrix.family != 'MP1' && matrix.family != 'MP2'}} | |
- name: Build tests/cmsis | |
working-directory: ${{ runner.workspace }}/tests/cmsis/build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE | |
if: ${{ matrix.family != 'MP1' && matrix.family != 'MP2'}} | |
Test-HAL: | |
runs-on: ubuntu-latest | |
needs: RetrieveTargetsMatrix | |
strategy: | |
matrix: ${{ fromJSON(needs.RetrieveTargetsMatrix.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/installToolchain | |
- name: Create build directory for tests/hal | |
run: cmake -E make_directory ${{ runner.workspace }}/tests/hal/build | |
- name: Configure tests/hal | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/hal/build | |
run: cmake -DTEST_FAMILIES=${{ matrix.family }} -DFETCH_ST_SOURCES=TRUE $GITHUB_WORKSPACE/tests/hal/ | |
- name: Create HAL config files from templates | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/hal/build | |
run: | | |
TEMPLATES=($(find _deps -name "*_template.h")) | |
for template in ${TEMPLATES[@]}; do | |
#get rid off "_template" in file name | |
DEST=$(basename ${template} | sed -rn "s@([^/]*)(_template)(\.h)@\1\3@p") | |
cp ${template} ${DEST} | |
done | |
if: ${{ matrix.family != 'MP2'}} | |
- name: Build tests/hal | |
working-directory: ${{ runner.workspace }}/tests/hal/build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE | |
Test-FreeRTOS: | |
runs-on: ubuntu-latest | |
needs: RetrieveTargetsMatrix | |
strategy: | |
matrix: ${{ fromJSON(needs.RetrieveTargetsMatrix.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/installToolchain | |
- name: Create build directory for tests/freertos | |
run: cmake -E make_directory ${{ runner.workspace }}/tests/freertos/build | |
- name: Check is Family has FreeRTOS Port | |
id: check_freertos_port | |
run: | | |
has_port=$(sed -nr "s@set\(STM32${{ matrix.family }}(_\w+)?_FREERTOS_PORT\s+(.*)\)@Found@p" cmake/stm32/*) | |
if [[ -n ${has_port} ]]; then | |
echo "FOUND=TRUE" >> $GITHUB_OUTPUT | |
fi | |
- name: Configure tests/freertos | |
if: ${{ steps.check_freertos_port.outputs.FOUND }} | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/freertos/build | |
run: cmake -DFAMILY=${{ matrix.family }} -DFETCH_ST_SOURCES=TRUE $GITHUB_WORKSPACE/tests/freertos/ | |
- name: Create HAL config files from templates | |
if: ${{ steps.check_freertos_port.outputs.FOUND && matrix.family != 'MP2' }} | |
shell: bash | |
working-directory: ${{ runner.workspace }}/tests/freertos/build | |
run: | | |
TEMPLATES=($(find _deps/*/Drivers/STM32${{ matrix.family }}*_HAL_Driver/Inc -name "*_template.h")) | |
for template in ${TEMPLATES[@]}; do | |
#get rid off "_template" in file name | |
DEST=$(basename ${template} | sed -rn "s@([^/]*)(_template)(\.h)@\1\3@p") | |
cp ${template} ${DEST} | |
done | |
- name: Build tests/freertos | |
if: ${{ steps.check_freertos_port.outputs.FOUND }} | |
working-directory: ${{ runner.workspace }}/tests/freertos/build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE |