Skip to content

Commit e6c7145

Browse files
authored
Reverting to build matrix approach (#13)
1 parent d45330d commit e6c7145

4 files changed

Lines changed: 109 additions & 248 deletions

File tree

.github/scripts/run-tests.sh

Lines changed: 0 additions & 195 deletions
This file was deleted.

.github/test-matrix.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/hello-ci-ubuntu-2404-arm.yml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,41 @@ env:
1616

1717
concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
19-
cancel-in-progress: true # Cancel previous runs on new push
19+
cancel-in-progress: true
2020

2121
jobs:
2222
install_build_execute:
2323
runs-on: ubuntu-24.04-arm
2424

25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
compiler: [
29+
{name: AC6, ext: axf},
30+
{name: GCC, ext: elf}
31+
]
32+
target: [
33+
{type: CM0, model: FVP_MPS2_Cortex-M0, uart: fvp_mps2.UART0},
34+
{type: CM0plus, model: FVP_MPS2_Cortex-M0plus, uart: fvp_mps2.UART0},
35+
{type: CM3, model: FVP_MPS2_Cortex-M3, uart: fvp_mps2.UART0},
36+
{type: CM4, model: FVP_MPS2_Cortex-M4, uart: fvp_mps2.UART0},
37+
{type: CM4_FP, model: FVP_MPS2_Cortex-M4, uart: fvp_mps2.UART0},
38+
{type: CM7, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
39+
{type: CM7_SP, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
40+
{type: CM7_DP, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
41+
{type: CM23, model: FVP_MPS2_Cortex-M23, uart: fvp_mps2.UART0},
42+
{type: CM33, model: FVP_MPS2_Cortex-M33, uart: fvp_mps2.UART0},
43+
{type: CM33_FP, model: FVP_MPS2_Cortex-M33, uart: fvp_mps2.UART0},
44+
{type: CS300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
45+
{type: CS310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
46+
{type: CS315, model: FVP_Corstone_SSE-315, uart: mps4_board.uart0},
47+
{type: CS320, model: FVP_Corstone_SSE-320, uart: mps4_board.uart0}
48+
]
49+
build: [
50+
{type: Release},
51+
{type: Debug}
52+
]
53+
2554
steps:
2655
- name: Checkout repo
2756
uses: actions/checkout@v6
@@ -35,21 +64,32 @@ jobs:
3564
- name: Cache packs
3665
uses: actions/cache@v5
3766
with:
38-
key: cmsis-packs-${{ hashFiles('*.csolution.yml', '*.cproject.yml') }}
39-
restore-keys: |
40-
cmsis-packs-
67+
key: cmsis-packs
4168
path: /home/runner/.cache/arm/packs
4269

43-
- name: Build and Execute All Configurations
70+
- name: Build context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} with ${{ matrix.compiler.name }}
4471
working-directory: ./
4572
run: |
46-
chmod +x .github/scripts/run-tests.sh
47-
.github/scripts/run-tests.sh .github/test-matrix.json
73+
cbuild Hello.csolution.yml --packs \
74+
--context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} \
75+
--toolchain ${{ matrix.compiler.name }} --rebuild
4876
49-
- name: Upload Failed Test Logs
50-
if: failure()
51-
uses: actions/upload-artifact@v6
52-
with:
53-
name: failed-test-logs-${{ github.workflow }}
54-
path: logs/
55-
retention-days: 30
77+
- name: Execute context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} with ${{ matrix.compiler.name }}
78+
working-directory: ./
79+
run: |
80+
${{ matrix.target.model }} \
81+
-a ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/Hello.${{ matrix.compiler.ext }} \
82+
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
83+
-C ${{ matrix.target.uart }}.out_file=./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log \
84+
--simlimit 60 --stat
85+
86+
echo " Show simulation UART output"
87+
cat ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log
88+
89+
echo "Checking simulation UART output"
90+
if [ "$(grep -c "Hello World 100" ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log)" -eq 1 ]
91+
then
92+
exit 0
93+
else
94+
exit 1
95+
fi

.github/workflows/hello-ci.yml

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,41 @@ on:
1111

1212
concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true # Cancel previous runs on new push
14+
cancel-in-progress: true
1515

1616
jobs:
17-
build_and_test:
17+
install_build_execute:
1818
runs-on: ubuntu-latest
1919

20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
compiler: [
24+
{name: AC6, ext: axf},
25+
{name: GCC, ext: elf}
26+
]
27+
target: [
28+
{type: CM0, model: FVP_MPS2_Cortex-M0, uart: fvp_mps2.UART0},
29+
{type: CM0plus, model: FVP_MPS2_Cortex-M0plus, uart: fvp_mps2.UART0},
30+
{type: CM3, model: FVP_MPS2_Cortex-M3, uart: fvp_mps2.UART0},
31+
{type: CM4, model: FVP_MPS2_Cortex-M4, uart: fvp_mps2.UART0},
32+
{type: CM4_FP, model: FVP_MPS2_Cortex-M4, uart: fvp_mps2.UART0},
33+
{type: CM7, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
34+
{type: CM7_SP, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
35+
{type: CM7_DP, model: FVP_MPS2_Cortex-M7, uart: fvp_mps2.UART0},
36+
{type: CM23, model: FVP_MPS2_Cortex-M23, uart: fvp_mps2.UART0},
37+
{type: CM33, model: FVP_MPS2_Cortex-M33, uart: fvp_mps2.UART0},
38+
{type: CM33_FP, model: FVP_MPS2_Cortex-M33, uart: fvp_mps2.UART0},
39+
{type: CS300, model: FVP_Corstone_SSE-300, uart: mps3_board.uart0},
40+
{type: CS310, model: FVP_Corstone_SSE-310, uart: mps3_board.uart0},
41+
{type: CS315, model: FVP_Corstone_SSE-315, uart: mps4_board.uart0},
42+
{type: CS320, model: FVP_Corstone_SSE-320, uart: mps4_board.uart0}
43+
]
44+
build: [
45+
{type: Release},
46+
{type: Debug}
47+
]
48+
2049
steps:
2150
- name: Checkout repo
2251
uses: actions/checkout@v6
@@ -30,21 +59,32 @@ jobs:
3059
- name: Cache packs
3160
uses: actions/cache@v5
3261
with:
33-
key: cmsis-packs-${{ hashFiles('*.csolution.yml', '*.cproject.yml') }}
34-
restore-keys: |
35-
cmsis-packs-
62+
key: cmsis-packs
3663
path: /home/runner/.cache/arm/packs
3764

38-
- name: Build and Execute All Configurations
65+
- name: Build context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} with ${{ matrix.compiler.name }}
3966
working-directory: ./
4067
run: |
41-
chmod +x .github/scripts/run-tests.sh
42-
.github/scripts/run-tests.sh .github/test-matrix.json
68+
cbuild Hello.csolution.yml --packs \
69+
--context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} \
70+
--toolchain ${{ matrix.compiler.name }} --rebuild
4371
44-
- name: Upload Failed Test Logs
45-
if: failure()
46-
uses: actions/upload-artifact@v6
47-
with:
48-
name: failed-test-logs-${{ github.workflow }}
49-
path: logs/
50-
retention-days: 30
72+
- name: Execute context Hello.${{ matrix.build.type }}+${{ matrix.target.type }} with ${{ matrix.compiler.name }}
73+
working-directory: ./
74+
run: |
75+
${{ matrix.target.model }} \
76+
-a ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/Hello.${{ matrix.compiler.ext }} \
77+
-f ./FVP/${{ matrix.target.model }}/fvp_config.txt \
78+
-C ${{ matrix.target.uart }}.out_file=./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log \
79+
--simlimit 60 --stat
80+
81+
echo " Show simulation UART output"
82+
cat ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log
83+
84+
echo "Checking simulation UART output"
85+
if [ "$(grep -c "Hello World 100" ./out/Hello/${{ matrix.target.type }}/${{ matrix.build.type }}/${{ matrix.compiler.name }}/fvp_stdout.log)" -eq 1 ]
86+
then
87+
exit 0
88+
else
89+
exit 1
90+
fi

0 commit comments

Comments
 (0)