diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e8dfc2ead3..e1072f8c45 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,14 +18,25 @@ concurrency: jobs: test: + name: test (${{matrix.os}}, ${{matrix.llvm}}, ${{matrix.suite}}) continue-on-error: true 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] + 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 @@ -69,20 +80,33 @@ 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' ' ') ;; + 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" + # 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: contains(matrix.suite, 'cl') env: LLGO_EMBED_TESTS: "1" run: go test -v -timeout 60m ./cl -run '^TestRunEmbedEmulator$' - name: Check std symbol coverage + if: contains(matrix.suite, 'rest') run: bash doc/_readme/scripts/check_std_cover.sh - name: Upload coverage reports to Codecov