|
| 1 | +# Copyright (c) 2026 Arm Limited (or its affiliates). All rights reserved. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://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, |
| 13 | +# WITHOUT 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 |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + pull_request: |
| 21 | + branches: [main] |
| 22 | + push: |
| 23 | + branches: [main] |
| 24 | + # schedule: |
| 25 | + # - cron: '00 20 * * 6' |
| 26 | + |
| 27 | +jobs: |
| 28 | + CI: |
| 29 | + strategy: |
| 30 | + fail-fast: false |
| 31 | + matrix: |
| 32 | + context: [ |
| 33 | + # toolchain, example directory, project name, build-type, target-type, artifact name, |
| 34 | + { tool: AC6, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugPlay, target-type: AppKit-E8-U85, artf_name: AC6_DebugPlay_AppKit-E8-U85 }, |
| 35 | + { tool: AC6, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugRec, target-type: AppKit-E8-U85, artf_name: AC6_DebugRec_AppKit-E8-U85 }, |
| 36 | + { tool: AC6, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleasePlay, target-type: AppKit-E8-U85, artf_name: AC6_ReleasePlay_AppKit-E8-U85 }, |
| 37 | + { tool: AC6, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleaseRec, target-type: AppKit-E8-U85, artf_name: AC6_ReleaseRec_AppKit-E8-U85 }, |
| 38 | + # { tool: GCC, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugPlay, target-type: AppKit-E8-U85, artf_name: GCC_DebugPlay_AppKit-E8-U85 }, |
| 39 | + # { tool: GCC, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugRec, target-type: AppKit-E8-U85, artf_name: GCC_DebugRec_AppKit-E8-U85 }, |
| 40 | + # { tool: GCC, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleasePlay, target-type: AppKit-E8-U85, artf_name: GCC_ReleasePlay_AppKit-E8-U85 }, |
| 41 | + # { tool: GCC, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleaseRec, target-type: AppKit-E8-U85, artf_name: GCC_ReleaseRec_AppKit-E8-U85 }, |
| 42 | + # { tool: IAR, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugPlay, target-type: AppKit-E8-U85, artf_name: IAR_DebugPlay_AppKit-E8-U85 }, |
| 43 | + # { tool: IAR, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: DebugRec, target-type: AppKit-E8-U85, artf_name: IAR_DebugRec_AppKit-E8-U85 }, |
| 44 | + # { tool: IAR, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleasePlay, target-type: AppKit-E8-U85, artf_name: IAR_ReleasePlay_AppKit-E8-U85 }, |
| 45 | + # { tool: IAR, dir: ./RockPaperScissors/AppKit-E8_USB, proj: AlgorithmTest, build-type: ReleaseRec, target-type: AppKit-E8-U85, artf_name: IAR_ReleaseRec_AppKit-E8-U85 } |
| 46 | + ] |
| 47 | + |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v6 |
| 53 | + |
| 54 | + - name: Activate vcpkg |
| 55 | + uses: ARM-software/cmsis-actions/vcpkg@v1 |
| 56 | + with: |
| 57 | + config: "./vcpkg-configuration.json" |
| 58 | + cache: "ModelNova" |
| 59 | + |
| 60 | + - name: Activate Arm tool license |
| 61 | + uses: ARM-software/cmsis-actions/armlm@v1 |
| 62 | + |
| 63 | + - name: Initialize CMSIS pack root folder |
| 64 | + run: | |
| 65 | + cpackget init https://www.keil.com/pack/index.pidx |
| 66 | + cpackget update-index |
| 67 | +
|
| 68 | + - name: Cache downloaded packs |
| 69 | + uses: actions/cache@v5 |
| 70 | + with: |
| 71 | + key: ModelNova |
| 72 | + path: /home/runner/.cache/arm/packs/.Download |
| 73 | + |
| 74 | + - name: ${{matrix.context.tool}} Build-Test for context ${{matrix.context.proj}}.${{matrix.context.build-type}}+${{matrix.context.target-type}} |
| 75 | + working-directory: ${{matrix.context.dir}} |
| 76 | + run: | |
| 77 | + cbuild SDS.csolution.yml --context ${{matrix.context.proj}}.${{matrix.context.build-type}}+${{matrix.context.target-type}} --toolchain ${{matrix.context.tool}} --packs |
| 78 | +
|
| 79 | + - name: Upload ${{matrix.context.tool}} output for context ${{matrix.context.proj}}.${{matrix.context.build-type}}+${{matrix.context.target-type}} |
| 80 | + uses: actions/upload-artifact@v7 |
| 81 | + with: |
| 82 | + name: ${{matrix.context.artf_name}} |
| 83 | + path: ${{matrix.context.dir}}/out/${{matrix.context.proj}}/${{matrix.context.target-type}} |
| 84 | + include-hidden-files: true |
0 commit comments