From fea6887bf765334be7a88ce3124833dc0ee23d97 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Wed, 8 Jul 2026 20:10:36 +0800 Subject: [PATCH 1/2] ci: one heavy test suite per runner VM Since the stage-5 backbone merged, the covered test run stacks four heavy, llgo-building test packages (cl, ssa, internal/cabi, test/go) on one runner; with the shared go-build cache their compile phases fully overlap and the concurrent clang/lld burst has been killing 16GB ubuntu runners mid-run ('runner received a shutdown signal', reproduced across main and every stage-5 branch) and starving mac runners into go-list WaitDelay expirations (printval/returnorder/ abitype flakes). Split the test job by suite (cl / ssa+cabi / test tree / rest): each VM runs one heavy package, so the peak cannot stack by construction, and wall time drops to the slowest single suite. Coverage still uploads from every job; codecov merges per commit. The embedded emulator step rides with cl, the std-symbol check with rest. --- .github/workflows/go.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e8dfc2ead3..03c03f2422 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,14 +18,22 @@ concurrency: jobs: test: + name: test (${{matrix.os}}, ${{matrix.llvm}}, ${{matrix.suite}}) continue-on-error: true timeout-minutes: 60 strategy: + fail-fast: false matrix: os: - macos-latest - ubuntu-latest llvm: [19] + # One heavy test package per runner VM: their compile phases no + # longer stack on a single 16GB machine (concurrent clang/lld + # bursts were killing ubuntu runners and starving mac runners + # into go-list WaitDelay expirations), and wall time drops to the + # slowest single suite. + suite: [cl, ssa, testgo, rest] runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v7 @@ -69,20 +77,31 @@ jobs: - name: Build run: go build -v ./... + - name: Select suite packages + id: suite + run: | + case "${{matrix.suite}}" in + cl) pkgs="./cl" ;; + ssa) pkgs="./ssa ./internal/cabi" ;; + testgo) pkgs="./test/..." ;; + rest) pkgs=$(go list ./... | grep -v -E '^github.com/goplus/llgo/(cl$|ssa$|internal/cabi$|test/)' | tr '\n' ' ') ;; + esac + echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT" + # Both platforms upload coverage: OS-specific paths (ELF vs Mach-O # emission, per-OS runtime shims) are otherwise invisible to # codecov/patch and fail it on lines only the other OS executes. - name: Test with coverage - # 45m: the caller-info acceptance suite (test/go) legitimately grew - # the covered run past the old 30m budget on macOS runners. - run: go test -timeout 45m -coverprofile="coverage.txt" -covermode=atomic ./... + run: go test -timeout 45m -coverprofile="coverage.txt" -covermode=atomic ${{steps.suite.outputs.pkgs}} - name: Test with embedded emulator env + if: matrix.suite == 'cl' env: LLGO_EMBED_TESTS: "1" run: go test -v -timeout 60m ./cl -run '^TestRunEmbedEmulator$' - name: Check std symbol coverage + if: matrix.suite == 'rest' run: bash doc/_readme/scripts/check_std_cover.sh - name: Upload coverage reports to Codecov From 2bd9e7b1bf21ece3fb7d0bf00b11738afba7d37f Mon Sep 17 00:00:00 2001 From: Li Jie Date: Wed, 8 Jul 2026 22:38:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20asymmetric=20suite=20split=20?= =?UTF-8?q?=E2=80=94=204=20VMs=20on=20ubuntu,=202=20balanced=20groups=20on?= =?UTF-8?q?=20scarce=20mac=20runners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 03c03f2422..e1072f8c45 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,17 +23,20 @@ jobs: timeout-minutes: 60 strategy: fail-fast: false + # Cap how many heavy, llgo-building test packages share one VM: + # their concurrent clang/lld bursts were killing 16GB ubuntu + # runners and starving mac runners into go-list WaitDelay + # expirations. ubuntu (plentiful runners) gets one suite per VM; + # macos (scarce runners) gets two balanced groups of at most two + # heavy packages each — the pre-backbone peak, which mac handled. matrix: - os: - - macos-latest - - ubuntu-latest - llvm: [19] - # One heavy test package per runner VM: their compile phases no - # longer stack on a single 16GB machine (concurrent clang/lld - # bursts were killing ubuntu runners and starving mac runners - # into go-list WaitDelay expirations), and wall time drops to the - # slowest single suite. - suite: [cl, ssa, testgo, rest] + include: + - { os: ubuntu-latest, llvm: 19, suite: cl } + - { os: ubuntu-latest, llvm: 19, suite: ssa } + - { os: ubuntu-latest, llvm: 19, suite: testgo } + - { os: ubuntu-latest, llvm: 19, suite: rest } + - { os: macos-latest, llvm: 19, suite: cl+cabi } + - { os: macos-latest, llvm: 19, suite: ssa+testgo+rest } runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v7 @@ -81,10 +84,12 @@ jobs: id: suite run: | case "${{matrix.suite}}" in - cl) pkgs="./cl" ;; - ssa) pkgs="./ssa ./internal/cabi" ;; - testgo) pkgs="./test/..." ;; - rest) pkgs=$(go list ./... | grep -v -E '^github.com/goplus/llgo/(cl$|ssa$|internal/cabi$|test/)' | tr '\n' ' ') ;; + cl) pkgs="./cl" ;; + ssa) pkgs="./ssa ./internal/cabi" ;; + testgo) pkgs="./test/..." ;; + rest) pkgs=$(go list ./... | grep -v -E '^github.com/goplus/llgo/(cl$|ssa$|internal/cabi$|test/)' | tr '\n' ' ') ;; + cl+cabi) pkgs="./cl ./internal/cabi" ;; + ssa+testgo+rest) pkgs="./ssa ./test/... $(go list ./... | grep -v -E '^github.com/goplus/llgo/(cl$|ssa$|internal/cabi$|test/)' | tr '\n' ' ')" ;; esac echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT" @@ -95,13 +100,13 @@ jobs: run: go test -timeout 45m -coverprofile="coverage.txt" -covermode=atomic ${{steps.suite.outputs.pkgs}} - name: Test with embedded emulator env - if: matrix.suite == 'cl' + if: contains(matrix.suite, 'cl') env: LLGO_EMBED_TESTS: "1" run: go test -v -timeout 60m ./cl -run '^TestRunEmbedEmulator$' - name: Check std symbol coverage - if: matrix.suite == 'rest' + if: contains(matrix.suite, 'rest') run: bash doc/_readme/scripts/check_std_cover.sh - name: Upload coverage reports to Codecov