|
| 1 | +# Copyright 2026 Arm Limited and/or its affiliates. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the License); you may |
| 6 | +# not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +name: Build and Run FVP_Hello Example |
| 18 | +on: |
| 19 | + |
| 20 | + workflow_dispatch: |
| 21 | + pull_request: |
| 22 | + paths: |
| 23 | + # Execute workflow when PR modifies this file |
| 24 | + - .github/workflows/Build_Run_FVP_Hello.yml |
| 25 | + # Execute workflow when PR modifies example directory |
| 26 | + - example/FVP_Hello/** |
| 27 | + push: |
| 28 | + # Execute workflow when main branch is updated |
| 29 | + branches: [main] |
| 30 | + |
| 31 | + #schedule: |
| 32 | + # - cron: '00 20 * * 6' |
| 33 | + |
| 34 | +concurrency: |
| 35 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 36 | + cancel-in-progress: true |
| 37 | + |
| 38 | +jobs: |
| 39 | + Build_Run: |
| 40 | + strategy: |
| 41 | + matrix: |
| 42 | + context: [ |
| 43 | + {proj: FVP_Hello, build_type: Debug, target_type: SSE-300, model: FVP_Corstone_SSE-300, layer: Corstone-300, mps: mps3}, |
| 44 | + {proj: FVP_Hello, build_type: Release, target_type: SSE-300, model: FVP_Corstone_SSE-300, layer: Corstone-300, mps: mps3}, |
| 45 | + |
| 46 | + {proj: FVP_Hello, build_type: Debug, target_type: SSE-310, model: FVP_Corstone_SSE-310, layer: Corstone-310, mps: mps3}, |
| 47 | + {proj: FVP_Hello, build_type: Release, target_type: SSE-310, model: FVP_Corstone_SSE-310, layer: Corstone-310, mps: mps3}, |
| 48 | + |
| 49 | + {proj: FVP_Hello, build_type: Debug, target_type: SSE-315, model: FVP_Corstone_SSE-315, layer: Corstone-315, mps: mps4}, |
| 50 | + {proj: FVP_Hello, build_type: Release, target_type: SSE-315, model: FVP_Corstone_SSE-315, layer: Corstone-315, mps: mps4}, |
| 51 | + |
| 52 | + {proj: FVP_Hello, build_type: Debug, target_type: SSE-320, model: FVP_Corstone_SSE-320, layer: Corstone-320, mps: mps4}, |
| 53 | + {proj: FVP_Hello, build_type: Release, target_type: SSE-320, model: FVP_Corstone_SSE-320, layer: Corstone-320, mps: mps4} |
| 54 | + ] |
| 55 | + toolchain: [ |
| 56 | + {name: AC6, ext: axf}, |
| 57 | + {name: GCC, ext: elf}, |
| 58 | + {name: CLANG, ext: elf} |
| 59 | + ] |
| 60 | + |
| 61 | + fail-fast: false |
| 62 | + |
| 63 | + runs-on: ubuntu-latest |
| 64 | + |
| 65 | + steps: |
| 66 | + - name: Checkout current repository |
| 67 | + uses: actions/checkout@v6 |
| 68 | + |
| 69 | + - name: Install tools |
| 70 | + uses: ARM-software/cmsis-actions/vcpkg@v1 |
| 71 | + with: |
| 72 | + config: ".ci/vcpkg-configuration.json" |
| 73 | + |
| 74 | + - name: Activate Arm tool license |
| 75 | + uses: ARM-software/cmsis-actions/armlm@v1 |
| 76 | + |
| 77 | + - name: Initialize CMSIS pack root folder |
| 78 | + run: | |
| 79 | + cpackget init https://www.keil.com/pack/index.pidx |
| 80 | + cpackget update-index |
| 81 | +
|
| 82 | + - name: Add local CMSIS packs |
| 83 | + run: | |
| 84 | + cpackget add ./ARM.AVH_FVP.pdsc |
| 85 | +
|
| 86 | + - name: Build example |
| 87 | + working-directory: ./example/FVP_Hello |
| 88 | + run: | |
| 89 | + cbuild FVP_Hello.csolution.yml \ |
| 90 | + --context .${{matrix.context.build_type}}+${{matrix.context.target_type}} \ |
| 91 | + --toolchain ${{matrix.toolchain.name}} \ |
| 92 | + --update-rte --rebuild --packs |
| 93 | +
|
| 94 | + - name: Execute example |
| 95 | + working-directory: ./example/FVP_Hello |
| 96 | + run: | |
| 97 | + ${{ matrix.context.model }} \ |
| 98 | + -a ./out/${{matrix.context.proj}}/${{matrix.context.target_type}}/${{matrix.context.build_type}}/${{matrix.context.proj}}.${{matrix.toolchain.ext}} \ |
| 99 | + -f ./board/${{matrix.context.layer}}/fvp_config.txt \ |
| 100 | + -C ${{matrix.context.mps}}_board.uart0.out_file=${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log \ |
| 101 | + --simlimit 30 |
| 102 | +
|
| 103 | + - name: Show example output |
| 104 | + working-directory: ./example/FVP_Hello |
| 105 | + run: | |
| 106 | + echo "FVP UART output:" |
| 107 | + cat ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log |
| 108 | +
|
| 109 | + - name: Check example output |
| 110 | + # Disable SSE-320 output check due to known issue with FVP UART output |
| 111 | + if: matrix.context.target_type != 'SSE-320' |
| 112 | + working-directory: ./example/FVP_Hello |
| 113 | + run: | |
| 114 | + echo "Check FVP UART output:" |
| 115 | + COUNT=$(grep "Hello World" ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log | wc -l) |
| 116 | + if [ "$COUNT" -eq 10 ]; then |
| 117 | + echo "Passed" |
| 118 | + else |
| 119 | + echo "Failed" |
| 120 | + exit 1 |
| 121 | + fi |
| 122 | +
|
| 123 | + - name: Upload FVP UART output log |
| 124 | + uses: actions/upload-artifact@v6 |
| 125 | + with: |
| 126 | + name: ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log |
| 127 | + path: ./example/FVP_Hello/${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log |
0 commit comments