Skip to content

Commit bfbea25

Browse files
committed
Try splitting tests
1 parent 8c29556 commit bfbea25

File tree

1 file changed

+70
-6
lines changed

1 file changed

+70
-6
lines changed

.github/workflows/tests.yml

Lines changed: 70 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,68 @@ 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+
uses: hashicorp-forge/go-test-split-action@v1
157+
with:
158+
total: 4
159+
index: ${{ matrix.index }}
160+
junit-summary: ./junit-test-summary.xml
129161
- name: gopherjs test ...
130-
if: matrix.os == 'ubuntu-latest'
162+
if: matrix.index
131163
run: |
132164
set -e
133165
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
166+
# gotestsum --junitfile node-summary.xml --format short-verbose -- -run "${{ steps.test_split.outputs.run }}"
167+
168+
# PACKAGE_NAMES=$( \
169+
# GOOS=js GOARCH=ecmascript go list std github.com/gopherjs/gopherjs/js/... github.com/gopherjs/gopherjs/tests/... \
170+
# | grep -v -x -f .std_test_pkg_exclusions \
171+
# )
172+
gopherjs test -p 2 --minify -v --short "${{ steps.test_split.outputs.run }}"
173+
- name: Upload test artifacts
174+
uses: actions/upload-artifact@v3
175+
with:
176+
name: junit-test-summary-${{ matrix.index }}
177+
path: node-summary.xml
178+
retention-days: 30
179+
180+
tests-combine-summaries:
181+
name: Combine Test Reports
182+
needs: [ tests ]
183+
runs-on: ubuntu-latest
184+
steps:
185+
- uses: actions/setup-node@v3
186+
with:
187+
node-version: 16
188+
189+
- name: Download artifacts
190+
uses: actions/download-artifact@v3
191+
192+
- name: Install junit-report-merger
193+
run: npm install -g junit-report-merger
194+
195+
- name: Merge reports
196+
run: jrm ./junit-test-summary.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml"
197+
198+
- name: Upload test artifacts
199+
uses: actions/upload-artifact@v3
200+
with:
201+
name: junit-test-summary
202+
path: ./junit-test-summary.xml

0 commit comments

Comments
 (0)