Skip to content

Commit 3828f38

Browse files
committed
Move build matrix to external config file fw/build_matrix.yaml
1 parent 04aeae5 commit 3828f38

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

.github/workflows/build_fw.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ on:
2020
required: false
2121
type: string
2222
jobs:
23+
load-matrix:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
matrix: ${{ steps.set-matrix.outputs.matrix }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Load matrix from file
32+
id: set-matrix
33+
run: |
34+
MATRIX=$(python3 -c "import yaml, json; print(json.dumps({'include': yaml.safe_load(open('fw/build_matrix.yaml'))}))")
35+
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
36+
2337
build:
2438
runs-on: ubuntu-latest
39+
needs: load-matrix
2540
strategy:
26-
matrix:
27-
include:
28-
- name: TFUNIPAYLOAD01
29-
type: TFUNIPAYLOAD
30-
env: TFUNIPAYLOAD01B_uart
31-
versioned: "true"
32-
- name: TFUNIPAYLOAD01
33-
type: TFUNIPAYLOAD_MINIMAL
34-
env: TFUNIPAYLOAD01B_uart
35-
versioned: "true"
36-
- name: TFUNIPAYLOAD01
37-
type: TFUNIPAYLOAD-hello-world
38-
env: TFUNIPAYLOAD01B_uart
39-
versioned: "false"
41+
matrix: ${{ fromJson(needs.load-matrix.outputs.matrix) }}
4042

4143
steps:
4244
- name: Checkout

fw/build_matrix.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- name: TFUNIPAYLOAD01
2+
type: TFUNIPAYLOAD
3+
env: TFUNIPAYLOAD01B_uart
4+
versioned: "true"
5+
- name: TFUNIPAYLOAD01
6+
type: TFUNIPAYLOAD_MINIMAL
7+
env: TFUNIPAYLOAD01B_uart
8+
versioned: "true"
9+
- name: TFUNIPAYLOAD01
10+
type: TFUNIPAYLOAD-hello-world
11+
env: TFUNIPAYLOAD01B_uart
12+
versioned: "false"

0 commit comments

Comments
 (0)