Skip to content

Commit 89e2d46

Browse files
committed
ci: split assert-test-linux into jobs that run at the same time
assert-test-linux ran the compiler test suite, the standard library tests, the smoke test, the wasm tests, and the baremetal tests one after the other, which took 31m26s. Add assert-build-linux, which publishes a tarball built with LLVM assertions. assert-stdlib-test-linux and assert-smoketest-linux download it, the same pattern as test-linux-build and smoketest-linux. assert-test-linux keeps the compiler test suite and runs at the same time. Only assert-test-linux saves the LLVM cache, thus the two jobs do not write the same key.
1 parent d88abc2 commit 89e2d46

1 file changed

Lines changed: 113 additions & 5 deletions

File tree

.github/workflows/linux.yml

Lines changed: 113 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,125 @@ jobs:
276276
- run: make gen-device -j4
277277
- name: Test TinyGo
278278
run: make ASSERT=1 test
279-
- name: Build TinyGo
279+
- name: Check Go code formatting
280+
run: make fmt-check lint
281+
282+
assert-build-linux:
283+
# Build TinyGo with LLVM assertions enabled and publish it for the jobs
284+
# below, so that they do not have to build it again. The tarball is not a
285+
# release file, thus its name does not hold the version.
286+
runs-on: ubuntu-24.04
287+
steps:
288+
- name: Checkout
289+
uses: actions/checkout@v6
290+
with:
291+
submodules: true
292+
- name: Install Go
293+
uses: actions/setup-go@v6
294+
with:
295+
go-version: '1.27.1'
296+
cache: true
297+
- uses: ./.github/actions/setup-llvm
298+
with:
299+
# assert-test-linux saves the cache. This job only reads it, so that
300+
# the two jobs do not write the same key.
301+
save-cache: "false"
302+
- name: Restore Binaryen
303+
uses: actions/cache/restore@v5
304+
id: cache-binaryen
305+
with:
306+
key: binaryen-linux-asserts-v1
307+
path: build/wasm-opt
308+
- name: Build Binaryen
309+
if: steps.cache-binaryen.outputs.cache-hit != 'true'
310+
run: make binaryen
311+
- run: make gen-device -j4
312+
- name: Build TinyGo release tarball
313+
run: |
314+
make release ASSERT=1 -j4
315+
cp -p build/release.tar.gz /tmp/tinygo-asserts.linux-amd64.tar.gz
316+
- name: Publish TinyGo build
317+
uses: actions/upload-artifact@v7
318+
with:
319+
name: tinygo-asserts.linux-amd64.tar.gz
320+
path: /tmp/tinygo-asserts.linux-amd64.tar.gz
321+
archive: false
322+
323+
assert-stdlib-test-linux:
324+
# Test the standard library with the assertions build.
325+
runs-on: ubuntu-24.04
326+
needs: assert-build-linux
327+
steps:
328+
- name: Checkout
329+
uses: actions/checkout@v6
330+
with:
331+
submodules: true
332+
- name: Install Go
333+
uses: actions/setup-go@v6
334+
with:
335+
go-version: '1.27.1'
336+
cache: true
337+
- name: Download TinyGo build
338+
uses: actions/download-artifact@v8
339+
with:
340+
name: tinygo-asserts.linux-amd64.tar.gz
341+
- name: Extract TinyGo build
280342
run: |
281-
make ASSERT=1
282-
echo "$(pwd)/build" >> $GITHUB_PATH
343+
mkdir -p ~/lib
344+
tar -C ~/lib -xf tinygo-asserts.linux-amd64.tar.gz
345+
ln -s ~/lib/tinygo/bin/tinygo ~/go/bin/tinygo
283346
- name: Test stdlib packages
284347
run: make tinygo-test
348+
349+
assert-smoketest-linux:
350+
# The smoke test, the wasm tests, and the baremetal tests, with the
351+
# assertions build.
352+
runs-on: ubuntu-24.04
353+
needs: assert-build-linux
354+
steps:
355+
- name: Checkout
356+
uses: actions/checkout@v6
357+
with:
358+
submodules: true
359+
- name: Install apt dependencies
360+
run: |
361+
sudo apt-get update
362+
sudo apt-get install --no-install-recommends \
363+
libgcrypt20 \
364+
libpixman-1-0 \
365+
libsdl2-2.0-0 \
366+
libslirp0 \
367+
qemu-system-arm \
368+
qemu-system-riscv32 \
369+
qemu-user \
370+
simavr
371+
- name: Install Go
372+
uses: actions/setup-go@v6
373+
with:
374+
go-version: '1.27.1'
375+
cache: true
376+
- name: Install Node.js
377+
uses: actions/setup-node@v6
378+
with:
379+
node-version: '22'
380+
- name: Install wasmtime
381+
uses: bytecodealliance/actions/wasmtime/setup@v1
382+
with:
383+
version: "29.0.1"
384+
- name: Setup `wasm-tools`
385+
uses: bytecodealliance/actions/wasm-tools/setup@v1
386+
- name: Download TinyGo build
387+
uses: actions/download-artifact@v8
388+
with:
389+
name: tinygo-asserts.linux-amd64.tar.gz
390+
- name: Extract TinyGo build
391+
run: |
392+
mkdir -p ~/lib
393+
tar -C ~/lib -xf tinygo-asserts.linux-amd64.tar.gz
394+
ln -s ~/lib/tinygo/bin/tinygo ~/go/bin/tinygo
285395
- run: make smoketest-quick
286396
- run: make wasmtest
287397
- run: make tinygo-test-baremetal
288-
- name: Check Go code formatting
289-
run: make fmt-check lint
290398
build-linux-cross:
291399
# Build ARM Linux binaries, ready for release.
292400
# This intentionally uses an older Linux image, so that we compile against

0 commit comments

Comments
 (0)