Skip to content

Commit a1aca06

Browse files
committed
build in parallel jobs
1 parent a09184f commit a1aca06

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: IDF v5.4 parallel build
2+
description: Build ESP32 Arduino libraries in parallel for multiple targets and create a framework archive.
3+
on:
4+
workflow_dispatch: # Manually start a workflow
5+
6+
jobs:
7+
build-libs:
8+
name: Build Libs for ${{ matrix.target }}
9+
runs-on: macos-14
10+
strategy:
11+
matrix:
12+
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4]
13+
fail-fast: false
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.11'
20+
- name: Install dependencies
21+
run: bash ./tools/prepare-ci.sh
22+
- name: Get current branch
23+
run: |
24+
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
25+
- name: Build Libs for ${{ matrix.target }}
26+
run: bash ./build.sh -e -t ${{ matrix.target }}
27+
- name: Upload artifacts for ${{ matrix.target }}
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: artifacts-${{ matrix.target }}
31+
path: dist
32+
33+
combine-artifacts:
34+
name: Combine artifacts and create framework
35+
needs: build-libs
36+
runs-on: macos-14
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.11'
43+
- name: Download artifacts
44+
uses: actions/download-artifact@v4
45+
with:
46+
path: dist
47+
pattern: artifacts-*
48+
merge-multiple: true
49+
- name: Combine artifacts into framework
50+
run: |
51+
mkdir -p out
52+
find dist -name 'framework-arduinoespressif32-*.zip' -exec unzip -q {} -d out \;
53+
cp out/package_esp32_index.template.json dist/package_esp32_index.template.json
54+
rm -f out/package_esp32_index.template.json
55+
# Create framework zip
56+
mkdir -p dist/framework-arduinoespressif32
57+
cp -r out/* dist/framework-arduinoespressif32/
58+
(cd dist && zip -qr framework-arduinoespressif32.zip framework-arduinoespressif32)
59+
# Create release info
60+
echo "Framework built with parallel approach for all ESP32 targets" > dist/release-info.txt
61+
- name: Upload framework artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: framework
65+
path: |
66+
dist/framework*
67+
dist/release-info.txt
68+
69+
build-slave_firmware:
70+
name: Build Slave Firmware
71+
runs-on: macos-14
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Set up Python
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: '3.11'
78+
- name: Install dependencies
79+
run: bash ./tools/prepare-ci.sh
80+
- name: Build slave firmware
81+
run: |
82+
bash ./tools/compile_slave.sh
83+
- name: Upload artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: slave_firmware
87+
path: |
88+
wifi_copro_fw
89+
90+
release_framework:
91+
name: Release Framework
92+
needs: [combine-artifacts, build-slave_firmware]
93+
runs-on: macos-14
94+
steps:
95+
- uses: actions/checkout@v4
96+
- name: Set up Python
97+
uses: actions/setup-python@v5
98+
with:
99+
python-version: '3.11'
100+
- name: Download framework artifact
101+
uses: actions/download-artifact@v4
102+
with:
103+
name: framework
104+
path: .
105+
- name: Download slave_firmware artifact
106+
uses: actions/download-artifact@v4
107+
with:
108+
name: slave_firmware
109+
path: .
110+
- name: Add slave_firmware to framework zip
111+
run: |
112+
FRAMEWORK_ZIP=$(ls dist/framework*.zip | head -n 1)
113+
unzip -q "$FRAMEWORK_ZIP" -d dist/unpacked
114+
cp -r wifi_copro_fw dist/unpacked/framework-arduinoespressif32/tools/slave_firmware
115+
(cd dist/unpacked && zip -qr ../$(basename "$FRAMEWORK_ZIP") .)
116+
- name: Release
117+
uses: jason2866/action-gh-release@v1.3
118+
with:
119+
tag_name: ${{ github.run_number }}
120+
body_path: release-info.txt
121+
prerelease: true
122+
files: |
123+
dist/framework*
124+
release-info.txt
125+
env:
126+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)