5454 steps :
5555 - uses : actions/checkout@v6
5656 - name : Install formatting tools
57- run : |
58- source .ci/common.sh
59-
60- # Install base tools
61- sudo apt-get update -q=2
62- sudo apt-get install -q=2 --no-install-recommends shfmt python3-pip gnupg ca-certificates
63-
64- # Install clang-format-20 from LLVM repository with proper keyring
65- LLVM_KEYRING=/usr/share/keyrings/llvm-archive-keyring.gpg
66- download_to_stdout https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o "$LLVM_KEYRING"
67- CODENAME=$(lsb_release -cs)
68- echo "deb [signed-by=${LLVM_KEYRING}] https://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-20 main" | sudo tee /etc/apt/sources.list.d/llvm-20.list
69- sudo apt-get update -q=2
70- sudo apt-get install -q=2 --no-install-recommends clang-format-20
71-
72- # Install Python formatter
73- pip3 install --break-system-packages black==25.1.0
57+ run : .ci/install-deps.sh format
7458 - name : Check newline at end of files
7559 run : .ci/check-newline.sh
7660 - name : Check code formatting
@@ -85,67 +69,35 @@ jobs:
8569 fail-fast : false
8670 matrix :
8771 os : [ubuntu-24.04, macos-latest]
88-
8972 steps :
90- - name : Checkout repository
91- uses : actions/checkout@v6
92-
93- - name : Install dependencies (Linux)
94- if : runner.os == 'Linux'
95- run : |
96- sudo apt-get update -q=2
97- sudo apt-get install -q=2 --no-install-recommends libsdl2-dev python3
98-
99- - name : Install dependencies (macOS)
100- if : runner.os == 'macOS'
101- run : |
102- brew install sdl2 python3
103-
104- - name : Set parallel jobs variable
73+ - uses : actions/checkout@v6
74+ - name : Install dependencies
75+ run : .ci/install-deps.sh sdl2
76+ - name : Build and test
10577 run : |
10678 source .ci/common.sh
107- echo "PARALLEL=$PARALLEL" >> "$GITHUB_ENV"
108-
109- - name : Configure and build
110- run : |
11179 make defconfig
11280 make $PARALLEL
113-
114- - name : Run unit tests
115- run : make check
81+ make check
11682
11783 headless-tests :
11884 needs : [detect-code-related-file-changes, unit-tests]
11985 if : needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
12086 timeout-minutes : 30
12187 runs-on : ubuntu-24.04
122-
12388 steps :
124- - name : Checkout repository
125- uses : actions/checkout@v6
126-
89+ - uses : actions/checkout@v6
12790 - name : Install dependencies
128- run : |
129- sudo apt-get update -q=2
130- sudo apt-get install -q=2 --no-install-recommends python3
131-
132- - name : Set parallel jobs variable
91+ run : .ci/install-deps.sh headless
92+ - name : Run headless tests
13393 run : |
13494 source .ci/common.sh
135- echo "PARALLEL=$PARALLEL" >> "$GITHUB_ENV"
136-
137- - name : Configure and run headless tests
138- run : |
139- # Generate .config file (required by Makefile)
14095 make defconfig
141- # Uses test library built with -DIUI_MD3_RUNTIME_VALIDATION
14296 make check-headless $PARALLEL
143-
14497 - name : Save screenshots on failure
14598 if : failure()
14699 run : python3 scripts/headless-test.py --lib .build/test/libiui.a -s
147100 continue-on-error : true
148-
149101 - name : Upload test artifacts
150102 if : failure()
151103 uses : actions/upload-artifact@v6
@@ -159,25 +111,15 @@ jobs:
159111 if : needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
160112 timeout-minutes : 30
161113 runs-on : ubuntu-24.04
162-
163114 steps :
164- - name : Checkout repository
165- uses : actions/checkout@v6
166-
115+ - uses : actions/checkout@v6
167116 - name : Install dependencies
168- run : |
169- sudo apt-get update -q=2
170- sudo apt-get install -q=2 --no-install-recommends libsdl2-dev python3
171-
172- - name : Set parallel jobs variable
173- run : |
174- source .ci/common.sh
175- echo "PARALLEL=$PARALLEL" >> "$GITHUB_ENV"
176-
177- - name : Configure and build with ASan
117+ run : .ci/install-deps.sh sdl2
118+ - name : Build and test with ASan
178119 run : |
179120 make defconfig
180- make check SANITIZERS=1
121+ echo "CONFIG_SANITIZERS=y" >> .config
122+ make check
181123
182124 build-matrix :
183125 needs : [detect-code-related-file-changes]
@@ -194,33 +136,68 @@ jobs:
194136 modules : " CONFIG_MODULE_BASIC=y"
195137 - config : " full"
196138 modules : " CONFIG_MODULE_BASIC=y CONFIG_MODULE_INPUT=y CONFIG_MODULE_CONTAINER=y"
197-
198139 steps :
199- - name : Checkout repository
200- uses : actions/checkout@v6
201-
140+ - uses : actions/checkout@v6
202141 - name : Install dependencies
203- run : |
204- sudo apt-get update -q=2
205- sudo apt-get install -q=2 --no-install-recommends libsdl2-dev python3
206-
207- - name : Set parallel jobs variable
142+ run : .ci/install-deps.sh sdl2
143+ - name : Build ${{ matrix.config }}
208144 run : |
209145 source .ci/common.sh
210- echo "PARALLEL=$PARALLEL" >> "$GITHUB_ENV"
211-
212- - name : Configure ${{ matrix.config }} build
213- run : |
214146 make defconfig
215- # Apply module configuration
216- for mod in ${{ matrix.modules }}; do
217- echo "$mod" >> .config
218- done
219-
220- - name : Build library
221- run : make libiui.a $PARALLEL
222-
223- - name : Check binary size
224- run : |
147+ for mod in ${{ matrix.modules }}; do echo "$mod" >> .config; done
148+ make libiui.a $PARALLEL
225149 size libiui.a || true
226150 ls -lh libiui.a
151+
152+ wasm-build :
153+ needs : [detect-code-related-file-changes]
154+ if : needs.detect-code-related-file-changes.outputs.has_code_related_changes == 'true'
155+ timeout-minutes : 30
156+ runs-on : ubuntu-24.04
157+ steps :
158+ - uses : actions/checkout@v6
159+ - name : Cache Emscripten
160+ uses : actions/cache@v5
161+ with :
162+ path : emsdk-cache
163+ key : emsdk-4.0.3-${{ runner.os }}
164+ - name : Setup Emscripten
165+ uses : mymindstorm/setup-emsdk@v14
166+ with :
167+ version : 4.0.3
168+ actions-cache-folder : emsdk-cache
169+ - name : Build WebAssembly
170+ run : .ci/build-wasm.sh build
171+ - name : Prepare deployment
172+ run : .ci/build-wasm.sh deploy-prep
173+ - name : Upload WASM artifacts
174+ uses : actions/upload-artifact@v6
175+ with :
176+ name : wasm-build
177+ path : deploy/
178+ retention-days : 7
179+
180+ deploy-pages :
181+ needs : [wasm-build]
182+ if : github.ref == 'refs/heads/main' && github.event_name == 'push'
183+ timeout-minutes : 10
184+ runs-on : ubuntu-24.04
185+ permissions :
186+ contents : read
187+ pages : write
188+ id-token : write
189+ environment :
190+ name : github-pages
191+ url : ${{ steps.deployment.outputs.page_url }}
192+ steps :
193+ - uses : actions/download-artifact@v6
194+ with :
195+ name : wasm-build
196+ path : deploy/
197+ - uses : actions/configure-pages@v5
198+ - uses : actions/upload-pages-artifact@v3
199+ with :
200+ path : deploy/
201+ - name : Deploy to GitHub Pages
202+ id : deployment
203+ uses : actions/deploy-pages@v4
0 commit comments