|
1 | 1 | name: "Hello: Test Build and Execution" |
| 2 | + |
2 | 3 | on: |
3 | 4 | workflow_dispatch: |
4 | 5 | pull_request: |
|
14 | 15 | schedule: |
15 | 16 | - cron: '00 20 * * 6' |
16 | 17 |
|
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: read-all |
| 23 | + |
17 | 24 | jobs: |
18 | | - Build: |
| 25 | + build-and-test: |
19 | 26 | runs-on: ubuntu-latest |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + toolchain: [AC6, GCC, CLANG] |
| 30 | + build_type: [Debug, Release] |
20 | 31 |
|
21 | 32 | steps: |
| 33 | + - name: Harden the runner (Audit all outbound calls) |
| 34 | + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
| 35 | + with: |
| 36 | + egress-policy: audit |
| 37 | + |
22 | 38 | - name: Checkout repo |
23 | | - uses: actions/checkout@v4 |
| 39 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
24 | 40 |
|
25 | 41 | - name: Install tools |
26 | | - uses: ARM-software/cmsis-actions/vcpkg@v1 |
| 42 | + uses: ARM-software/cmsis-actions/vcpkg@75fd924d583d17eacdbfaf77f21ca09e335c3c79 # v1 |
27 | 43 | with: |
28 | 44 | config: ".ci/vcpkg-configuration.json" |
29 | 45 |
|
30 | 46 | - name: Activate Arm tool license |
31 | | - uses: ARM-software/cmsis-actions/armlm@v1 |
32 | | - |
33 | | - - name: Build Hello with AC6 and all contexts |
34 | | - working-directory: ./Hello/ |
35 | | - run: cbuild Hello.csolution.yml --packs --toolchain AC6 |
| 47 | + uses: ARM-software/cmsis-actions/armlm@75fd924d583d17eacdbfaf77f21ca09e335c3c79 # v1 |
36 | 48 |
|
37 | | - - name: Run Hello build-type Debug, AC6 |
| 49 | + - name: Build Hello with ${{ matrix.toolchain }} |
38 | 50 | working-directory: ./Hello/ |
39 | 51 | run: | |
40 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Debug/Hello.axf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
41 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Debug/AC6_fvp_stdout.log \ |
42 | | - --simlimit 60 --stat |
43 | | - echo " Show simulation UART output build with AC6 Debug" |
44 | | - cat ./out/Hello/CS300/Debug/AC6_fvp_stdout.log |
| 52 | + echo "Building with toolchain: ${{ matrix.toolchain }}" |
| 53 | + cbuild Hello.csolution.yml --packs --toolchain ${{ matrix.toolchain }} |
45 | 54 |
|
46 | | - - name: Run Hello build-type Release, AC6 |
| 55 | + - name: Run Hello Simulation ${{ matrix.toolchain }}-${{ matrix.build_type }} |
47 | 56 | working-directory: ./Hello/ |
48 | 57 | run: | |
49 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Release/Hello.axf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
50 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Release/AC6_fvp_stdout.log \ |
51 | | - --simlimit 60 --stat |
52 | | - echo " Show simulation UART output build with AC6 Release" |
53 | | - cat ./out/Hello/CS300/Release/AC6_fvp_stdout.log |
| 58 | + # Determine file extension |
| 59 | + EXT="elf" |
| 60 | + if [[ "${{ matrix.toolchain }}" == "AC6" ]]; then EXT="axf"; fi |
54 | 61 |
|
55 | | - - name: Build Hello with GCC and all contexts |
56 | | - working-directory: ./Hello/ |
57 | | - run: cbuild Hello.csolution.yml --packs --toolchain GCC |
| 62 | + EXEC=./out/Hello/CS300/${{ matrix.build_type }}/Hello.${EXT} |
| 63 | + LOG=./out/Hello/CS300/${{ matrix.build_type }}/${{ matrix.toolchain }}_fvp_stdout.log |
58 | 64 |
|
59 | | - - name: Run Hello build-type Debug, GCC |
60 | | - working-directory: ./Hello/ |
61 | | - run: | |
62 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Debug/Hello.elf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
63 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Debug/GCC_fvp_stdout.log \ |
| 65 | + FVP_Corstone_SSE-300 \ |
| 66 | + -a $EXEC \ |
| 67 | + -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
| 68 | + -C mps3_board.uart0.out_file=$LOG \ |
64 | 69 | --simlimit 60 --stat |
65 | | - echo " Show simulation UART output build with GCC Debug" |
66 | | - cat ./out/Hello/CS300/Debug/GCC_fvp_stdout.log |
67 | 70 |
|
68 | | - - name: Run Hello build-type Release, GCC |
69 | | - working-directory: ./Hello/ |
70 | | - run: | |
71 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Release/Hello.elf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
72 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Release/GCC_fvp_stdout.log \ |
73 | | - --simlimit 60 --stat |
74 | | - echo " Show simulation UART output build with GCC Release" |
75 | | - cat ./out/Hello/CS300/Release/GCC_fvp_stdout.log |
76 | | -
|
77 | | - - name: Build Hello with CLANG and all contexts |
78 | | - working-directory: ./Hello/ |
79 | | - run: cbuild Hello.csolution.yml --packs --toolchain CLANG |
80 | | - |
81 | | - - name: Run Hello build-type Debug, CLANG |
82 | | - working-directory: ./Hello/ |
83 | | - run: | |
84 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Debug/Hello.elf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
85 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Debug/CLANG_fvp_stdout.log \ |
86 | | - --simlimit 60 --stat |
87 | | - echo " Show simulation UART output build with CLANG Debug" |
88 | | - cat ./out/Hello/CS300/Debug/CLANG_fvp_stdout.log |
89 | | -
|
90 | | - - name: Run Hello build-type Release, CLANG |
91 | | - working-directory: ./Hello/ |
92 | | - run: | |
93 | | - FVP_Corstone_SSE-300 -a ./out/Hello/CS300/Release/Hello.elf -f ./../FVP/FVP_Corstone_SSE-300/fvp_config.txt \ |
94 | | - -C mps3_board.uart0.out_file=./out/Hello/CS300/Release/CLANG_fvp_stdout.log \ |
95 | | - --simlimit 60 --stat |
96 | | - echo " Show simulation UART output build with CLANG Release" |
97 | | - cat ./out/Hello/CS300/Release/CLANG_fvp_stdout.log |
| 71 | + echo "Show simulation UART output for ${{ matrix.toolchain }} ${{ matrix.build_type }}" |
| 72 | + cat $LOG |
0 commit comments