Skip to content

Commit 0d2fedf

Browse files
Improve build
1 parent bde9f1f commit 0d2fedf

File tree

5 files changed

+73
-75
lines changed

5 files changed

+73
-75
lines changed

.github/actions/wasi_sdk/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ runs:
1111
using: "composite"
1212
steps:
1313

14-
- name: Cache WASI SDK
15-
id: cache-wasi-sdk
16-
uses: actions/cache@v4
17-
with:
18-
path: /opt/wasi-sdk
19-
key: 'wasi-sdk-${{ inputs.version }}-${{ inputs.arch }}'
20-
2114
- name: Install WASI SDK
2215
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
2316
shell: bash

.github/workflows/actions.yml

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ on:
1010
- '**.md'
1111
- '.github/ISSUE_TEMPLATE/**'
1212
- '.github/workflows/nightly.yml'
13-
- '.github/workflows/linux_cpn.yml'
14-
- '.github/workflows/macosx_cpn.yml'
15-
- '.github/workflows/win-cpn-32.yml'
16-
- '.github/workflows/win_cpn-64.yml'
13+
- '.github/workflows/companion.yml'
1714
- '.github/workflows/validate_fw_json.yml'
1815
- 'companion/**'
1916
- '.gitpod.yml'
@@ -26,10 +23,7 @@ on:
2623
- '**.md'
2724
- '.github/ISSUE_TEMPLATE/**'
2825
- '.github/workflows/nightly.yml'
29-
- '.github/workflows/linux_cpn.yml'
30-
- '.github/workflows/macosx_cpn.yml'
31-
- '.github/workflows/win-cpn-32.yml'
32-
- '.github/workflows/win_cpn-64.yml'
26+
- '.github/workflows/companion.yml'
3327
- '.github/workflows/validate_fw_json.yml'
3428
- 'companion/**'
3529
- '.gitpod.yml'
@@ -44,27 +38,21 @@ jobs:
4438
strategy:
4539
matrix:
4640
target:
47-
- x9dp2019
41+
- x9dp2019;x9e
4842
- tx15
4943
- tx16s
5044
- nv14
5145
- el18
5246
- pl18
5347
- pl18ev
54-
- t12max
48+
- t12max;t14
5549
- t15
5650
- t16
5751
- t18
58-
- tlite #STM32F2
59-
- t20
60-
- t14
61-
- t20v2
62-
- tx12 #STM32F2
52+
- t20;t20v2
6353
- x10
6454
- x12s
65-
- x9e
66-
- mt12
67-
- gx12
55+
- mt12;gx12
6856
- nb4p
6957
- st16
7058
container:
@@ -76,7 +64,6 @@ jobs:
7664
uses: actions/checkout@v4
7765
with:
7866
submodules: recursive
79-
# fetch-depth: 0 # https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
8067

8168
- name: Test ${{ matrix.target }}
8269
env:
@@ -85,7 +72,6 @@ jobs:
8572
echo "Running commit tests"
8673
./tools/commit-tests.sh
8774
88-
8975
build:
9076
name: Run builds
9177
needs: test
@@ -94,26 +80,20 @@ jobs:
9480
matrix:
9581
target:
9682
- nv14;el18
97-
- pl18;pl18ev;pl18u
98-
- pa01
99-
- t12max
100-
- t15;t16;t18
101-
- zorro;pocket;mt12;commando8
83+
- pl18;pl18ev
84+
- pl18u;pa01
85+
- t15;t16
86+
- t14;t18;mt12
87+
- zorro;pocket;commando8
10288
- tprov2;tpros;bumblebee
103-
- t20;t20v2;t14
104-
- tx12mk2;boxer;gx12
105-
- tx15
106-
- tx16s
107-
- f16
89+
- mt12;gx12;t20;t20v2
90+
- t12max;tx12mk2;boxer
91+
- tx15;tx16s
92+
- x12s;f16
10893
- v12;v14;v16
10994
- x10;x10express
110-
- x12s
111-
- x7access
112-
- x9dp2019
113-
- x9e;x9e-hall
114-
- mt12;gx12
115-
- nb4p
116-
- st16
95+
- x7access;x9dp2019;x9e;x9e-hall
96+
- nb4p;st16
11797
container:
11898
image: ghcr.io/edgetx/edgetx-dev:latest
11999
volumes:
@@ -149,7 +129,6 @@ jobs:
149129
runs-on: ubuntu-latest
150130
steps:
151131
- name: Compose release filename
152-
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
153132
run: echo "artifact_name=edgetx-firmware-${GITHUB_REF##*/}" >> $GITHUB_ENV
154133

155134
- name: Merge firmware artifact packages

.github/workflows/companion.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,34 @@ on:
2222
workflow_dispatch:
2323

2424
jobs:
25-
build-modules:
26-
name: WASM Modules
25+
modules:
26+
name: WASM Modules (${{ matrix.group.id }})
2727
runs-on: macos-14
28+
strategy:
29+
matrix:
30+
group:
31+
- id: color-1
32+
target: [nv14, el18, pl18, pl18ev]
33+
- id: color-2
34+
target: [pl18u, t15, t16, t18]
35+
- id: bw-1
36+
target: [zorro, pocket, mt12, commando8, tprov2, tpros, bumblebee, t14]
37+
- id: bw-2
38+
target: [mt12, gx12, t20, t20v2, t12max, tx12mk2, boxer]
39+
- id: color-3
40+
target: [tx15, tx16s, x12s, f16]
41+
- id: mixed-1
42+
target: [v12, v14, v16, x10, x10express]
43+
- id: bw-3
44+
target: [x7access, x9dp2019, x9e, x9e-hall]
45+
- id: color-4
46+
target: [nb4p, st16, pa01]
2847

2948
steps:
3049
- name: Check out the repo
3150
uses: actions/checkout@v4
3251
with:
33-
submodules: recursive
52+
submodules: true
3453

3554
- name: Setup Python Dependencies
3655
uses: ./.github/actions/python_dependencies
@@ -41,26 +60,24 @@ jobs:
4160
- name: Build modules
4261
shell: bash
4362
env:
63+
FLAVOR: ${{ join(matrix.group.target, ';') }}
4464
CMAKE_BUILD_TYPE: 'Release'
4565
run: |
4666
mkdir output && \
4767
tools/build-wasm-modules.sh "$(pwd)" "$(pwd)/output/"
4868
49-
- name: Compose artifact name
50-
run: echo "artifact_name=edgetx-modules-${GITHUB_REF##*/}" >> $GITHUB_ENV
51-
shell: bash
52-
5369
- name: Archive production artifacts
5470
uses: actions/upload-artifact@v4
5571
with:
56-
name: "${{ env.artifact_name }}"
72+
name: wasm-modules-${{ matrix.group.id }}
5773
path: ${{github.workspace}}/output
74+
if-no-files-found: error
5875
retention-days: 15
5976

6077
build-linux:
6178
name: Linux Companion
6279
runs-on: ubuntu-latest
63-
if: false
80+
needs: modules
6481

6582
container:
6683
image: ghcr.io/edgetx/edgetx-dev:latest
@@ -81,7 +98,7 @@ jobs:
8198
build-macos:
8299
name: macOS Companion
83100
runs-on: macos-14
84-
if: false
101+
needs: modules
85102

86103
env:
87104
CMAKE_OSX_ARCHITECTURES: 'x86_64'
@@ -102,7 +119,7 @@ jobs:
102119
build-win64:
103120
name: Windows Companion
104121
runs-on: windows-2022
105-
if: false
122+
needs: modules
106123

107124
env:
108125
CMAKE_GENERATOR: 'Ninja'

tools/build-wasm-modules.sh

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,37 @@ build_plugin() {
163163
return 0
164164
}
165165

166-
declare -a simulator_plugins=(
167-
x7access x9dp2019 x9e
168-
t12max tx12mk2 t15 t16 t18 t20 t20v2
169-
x10 x10express x12s
170-
zorro tx16s tx15
171-
commando8 boxer pocket mt12 gx12
172-
tprov2 tpros bumblebee t14
173-
nv14 el18 pl18 pl18ev pl18u st16 pa01
174-
f16 v14 v16
175-
)
176-
177-
TOTAL=${#simulator_plugins[@]}
166+
if [[ -n "$FLAVOR" ]]; then
167+
# Convert semicolon-separated string to array
168+
IFS=';' read -ra temp_array <<< "$FLAVOR"
169+
plugins=()
170+
for item in "${temp_array[@]}"; do
171+
plugins+=($(echo "$item" | tr '[:upper:]' '[:lower:]'))
172+
done
173+
else
174+
declare -a plugins=(
175+
# monochrom
176+
boxer bumblebee commando8
177+
gx12 mt12 pocket t12max
178+
t14 t20 t20v2 tpros tprov2
179+
tx12mk2 zorro v14
180+
x7access x9dp2019 x9e
181+
# colour
182+
el18 nv14 st16 pa01
183+
pl18 pl18ev pl18u
184+
t15 t16 t18
185+
tx15 tx16s f16 v16
186+
x10 x10express x12s
187+
)
188+
fi
189+
190+
TOTAL=${#plugins[@]}
178191
FAILED_PLUGINS=()
179192

180193
echo "🔨 Building $TOTAL Plugins"
181194

182-
for i in "${!simulator_plugins[@]}"; do
183-
plugin="${simulator_plugins[$i]}"
195+
for i in "${!plugins[@]}"; do
196+
plugin="${plugins[$i]}"
184197
current=$((i + 1))
185198
percent=$((current * 100 / TOTAL))
186199

tools/commit-tests.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ do
7878
fi
7979

8080
cmake ${BUILD_OPTIONS} "${SRCDIR}"
81-
82-
cmake --build . --target arm-none-eabi-configure
83-
cmake --build arm-none-eabi -j"${CORES}" --target ${FIRMARE_TARGET}
84-
8581
cmake --build . --target native-configure
8682
cmake --build native -j"${CORES}" --target tests-radio
8783

88-
rm -f CMakeCache.txt native/CMakeCache.txt arm-none-eabi/CMakeCache.txt
84+
rm -f CMakeCache.txt native/CMakeCache.txt
8985
done

0 commit comments

Comments
 (0)