Test MDK-Middleware RefApps #2
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: Test MDK-Middleware RefApps # MDK-Middleware Reference Applications (Examples) | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
schedule: | |
- cron: '00 20 * * 6' | |
jobs: | |
Test: # Install tools, build | |
runs-on: ubuntu-latest | |
env: | |
TARGET_BOARD: NUCLEO-H743ZI2 | |
strategy: | |
fail-fast: false | |
matrix: | |
solution: [ | |
# {name: FileSystem, dir: FileSystem, layer_ac6: ./BSP/Layers/Default, layer_gcc: ./.ci/Layers/Default_GCC}, | |
{name: Network, dir: Network, layer_ac6: ./BSP/Layers/Default, layer_gcc: ./.ci/Layers/Default_GCC}, | |
{name: USB_Device, dir: USB/Device, layer_ac6: ./BSP/Layers/Default, layer_gcc: ./.ci/Layers/Default_GCC}, | |
# {name: USB_Host, dir: USB/Host, layer_ac6: ./BSP/Layers/Default, layer_gcc: ./.ci/Layers/Default_GCC} | |
] | |
steps: | |
- name: Checkout .ci folder | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
.ci | |
- name: Install tools | |
uses: ARM-software/cmsis-actions/vcpkg@v1 | |
with: | |
config: "./.ci/vcpkg-configuration.json" | |
- name: Activate Arm tool license | |
uses: ARM-software/cmsis-actions/armlm@v1 | |
- name: Checkout current repository | |
uses: actions/checkout@v4 | |
with: | |
path: ./BSP | |
- name: Checkout STM32H7xx_DFP | |
uses: actions/checkout@v4 | |
with: | |
repository: Open-CMSIS-Pack/STM32H7xx_DFP | |
path: ./DFP | |
- name: Checkout MDK-Middleware | |
uses: actions/checkout@v4 | |
with: | |
repository: ARM-software/MDK-Middleware | |
path: ./MDK-Middleware | |
- name: Checkout CMSIS-Driver_STM32 | |
uses: actions/checkout@v4 | |
with: | |
repository: Open-CMSIS-Pack/CMSIS-Driver_STM32 | |
path: ./Drivers | |
- name: Initialize CMSIS pack root folder | |
run: | | |
cpackget init https://www.keil.com/pack/index.pidx | |
cpackget update-index | |
- name: Add local CMSIS packs | |
run: | | |
cpackget add ./BSP/Keil.NUCLEO-H743ZI2_BSP.pdsc | |
cpackget add ./DFP/Keil.STM32H7xx_DFP.pdsc | |
cpackget add ./MDK-Middleware/Keil.MDK-Middleware.pdsc | |
cpackget add ./Drivers/ARM.CMSIS-Driver_STM32.pdsc | |
- name: Copy example structure to CI/MW-RefApps/ folder | |
working-directory: ./ | |
run: | | |
mkdir -p ./CI/MW-RefApps/Examples/ | |
mkdir -p ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/Board/ | |
cp -rf ./MDK-Middleware/Examples/* ./CI/MW-RefApps/Examples/ | |
if [ -e ./.ci/MW-RefApps/Examples/${{ matrix.solution.dir }}/${{ matrix.solution.name }}.csolution.yml ] | |
then | |
cp -rf ./.ci/MW-RefApps/Examples/${{ matrix.solution.dir }}/${{ matrix.solution.name }}.csolution.yml ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/${{ matrix.solution.name }}.csolution.yml | |
fi | |
sed -i "s|target-types:|&\n - type: $TARGET_BOARD\n board: $TARGET_BOARD\n variables:\n - Board-Layer: \$SolutionDir()\$/Board/Board.clayer.yml|" ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/${{ matrix.solution.name }}.csolution.yml | |
- name: Update board layer for ${{ matrix.solution.name }} AC6 build test | |
if: always() | |
working-directory: ./ | |
run: | | |
cp -rf ${{ matrix.solution.layer_ac6 }}/* ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/Board/ # Copy the Board layer | |
- name: ${{ matrix.solution.name }} AC6 build test | |
if: always() | |
working-directory: ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/ | |
run: | | |
cbuild ./${{ matrix.solution.name }}.csolution.yml --update-rte --packs \ | |
--toolchain AC6 --rebuild | |
- name: Upload Artifact of the ${{ matrix.solution.name }} AC6 build | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.solution.name }}_AC6 | |
path: | | |
./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/ | |
!./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/tmp/ | |
retention-days: 1 | |
- name: Update board layer for ${{ matrix.solution.name }} GCC build test | |
if: always() | |
working-directory: ./ | |
run: | | |
rm -rf ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/Board/* | |
cp -rf ${{ matrix.solution.layer_gcc }}/* ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/Board/ # Copy the Board layer | |
- name: ${{ matrix.solution.name }} GCC build test | |
if: always() | |
working-directory: ./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/ | |
run: | | |
rm -rf out | |
rm -rf tmp | |
cbuild ./${{ matrix.solution.name }}.csolution.yml --update-rte --packs \ | |
--toolchain GCC --rebuild | |
- name: Upload Artifact of the ${{ matrix.solution.name }} GCC build | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.solution.name }}_GCC | |
path: | | |
./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/ | |
!./CI/MW-RefApps/Examples/${{ matrix.solution.dir }}/tmp/ | |
retention-days: 1 |