From e083ed31e638e5331234da78780a043c4e09a5c1 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 27 Aug 2026 22:14:31 +0200 Subject: [PATCH] ci: run the full smoke test once, on Linux only The smoke test ran six times for each push: twice on Linux, twice on macOS, once on Windows, and once in the compatibility test. Together that was about 97 minutes of the CI time. The smoke test checks that TinyGo can build a binary for each board. That does not depend on the host OS. The only part that does is one build behind a Windows check. Add a smoketest-linux job that runs the full set, split across four runners that use the tarball from the build-linux job. The groups are balanced with the measured build time of each group. Remove the full smoke test from test-linux-build, which the new job replaces, and use smoketest-quick for the other four jobs. Expected result: about 55 to 39 minutes for the slowest workflow, and about 97 to 35 minutes of total smoke test time. --- .github/workflows/build-macos.yml | 2 +- .github/workflows/compat.yml | 2 +- .github/workflows/linux.yml | 40 +++++++++++++++++++++++++++++-- .github/workflows/windows.yml | 2 +- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 19bb64014..c1a263c47 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -107,7 +107,7 @@ jobs: path: build/tinygo${{ steps.version.outputs.version }}.darwin-${{ matrix.goarch }}.tar.gz archive: false - name: Smoke tests - run: make smoketest TINYGO=$(PWD)/build/tinygo + run: make smoketest-quick TINYGO=$(PWD)/build/tinygo test-macos-homebrew: name: homebrew-install runs-on: macos-latest diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index 2d01dd47d..2c658c45b 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -69,4 +69,4 @@ jobs: - run: tinygo version - run: make gen-device -j4 - run: go test -tags=llvm${{ env.LLVM }} -short -skip=TestErrors - - run: make smoketest XTENSA=0 + - run: make smoketest-quick XTENSA=0 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 10e080763..ce3f0acb4 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -180,7 +180,43 @@ jobs: - run: make tinygo-test-wasip1-fast - run: make tinygo-test-wasip2-fast - run: make tinygo-test-wasm - - run: make smoketest + smoketest-linux: + # Build a binary for every supported board, using the binaries built in the + # build-linux job. This is the only job that runs the full smoke test. The + # result does not depend on the host OS, so the other jobs build a + # representative board for each architecture with smoketest-quick. + runs-on: ubuntu-latest + needs: build-linux + strategy: + fail-fast: false + matrix: + # Balanced with the measured build time of each group, so that the + # shards finish at about the same time. + group: + - smoketest-rp2xxx smoketest-selftest smoketest-wasm-sim + - smoketest-esp smoketest-riscv smoketest-flags + - smoketest-examples smoketest-nxp smoketest-pwm-usb smoketest-avr + - smoketest-samd smoketest-stm32 smoketest-nrf smoketest-wasm + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: true + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: '1.27.0' + cache: true + - name: Download release artifact + uses: actions/download-artifact@v8 + with: + name: tinygo${{ needs.build-linux.outputs.version }}.linux-amd64.tar.gz + - name: Extract release tarball + run: | + mkdir -p ~/lib + tar -C ~/lib -xf tinygo${{ needs.build-linux.outputs.version }}.linux-amd64.tar.gz + ln -s ~/lib/tinygo/bin/tinygo ~/go/bin/tinygo + - run: make testchdir ${{ matrix.group }} assert-test-linux: # Run all tests that can run on Linux, with LLVM assertions enabled to catch # potential bugs. @@ -293,7 +329,7 @@ jobs: echo "$(pwd)/build" >> $GITHUB_PATH - name: Test stdlib packages run: make tinygo-test - - run: make smoketest + - run: make smoketest-quick - run: make wasmtest - run: make tinygo-test-baremetal - name: Check Go code formatting diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8d86f7c43..62f518b37 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -139,7 +139,7 @@ jobs: # This build is already unzipped. - name: Smoke tests shell: bash - run: make smoketest TINYGO=$(PWD)/build/tinygo/bin/tinygo + run: make smoketest-quick TINYGO=$(PWD)/build/tinygo/bin/tinygo stdlib-test-windows: runs-on: windows-2022