Skip to content

Commit 03a8e76

Browse files
committed
Try splitting tests
1 parent 8c29556 commit 03a8e76

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

.github/workflows/tests.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13+
include:
14+
- os: ubuntu-latest
15+
index: 1
16+
- os: ubuntu-latest
17+
index: 2
18+
- os: ubuntu-latest
19+
index: 3
20+
- os: ubuntu-latest
21+
index: 4
1322

1423
steps:
1524
- uses: actions/setup-go@v3
@@ -126,13 +135,39 @@ jobs:
126135
- name: Go Repository tests
127136
run: |
128137
go test -v github.com/gopherjs/gopherjs/tests/gorepo
138+
139+
- name: Download JUnit Summary from Previous Workflow
140+
if: matrix.index
141+
id: download-artifact
142+
uses: dawidd6/action-download-artifact@v2
143+
with:
144+
workflow_conclusion: success
145+
name: junit-test-summary
146+
if_no_artifact_found: warn
147+
# Uncomment the next line before pushing to main branch, that way all branches can
148+
# benefit from timing data once it's established there.
149+
# branch: main
150+
151+
- name: Install gotestsum
152+
if: matrix.index
153+
run: go install gotest.tools/gotestsum@latest
154+
- name: Generate go test Slice
155+
if: matrix.index
156+
id: test_split
157+
env:
158+
GOOS: js
159+
GOARCH: ecmascript
160+
uses: hashicorp-forge/go-test-split-action@v1
161+
with:
162+
total: 4
163+
index: ${{ matrix.index }}
164+
packages: "std github.com/gopherjs/gopherjs/js/... github.com/gopherjs/gopherjs/tests/..."
129165
- name: gopherjs test ...
130-
if: matrix.os == 'ubuntu-latest'
166+
if: matrix.index
131167
run: |
132168
set -e
133169
ulimit -s 10000
134-
PACKAGE_NAMES=$( \
135-
GOOS=js GOARCH=ecmascript go list std github.com/gopherjs/gopherjs/js/... github.com/gopherjs/gopherjs/tests/... \
136-
| grep -v -x -f .std_test_pkg_exclusions \
137-
)
138-
gopherjs test -p 2 --minify -v --short $PACKAGE_NAMES
170+
171+
PACKAGE_NAMES=$(for pkg in ${{ steps.test_split.outputs.run }}; do echo "$pkg"; done | grep -v -x -f .std_test_pkg_exclusions)
172+
173+
gopherjs test -p 2 --minify -v --short "${{ steps.test_split.outputs.run }}"

0 commit comments

Comments
 (0)