-
Notifications
You must be signed in to change notification settings - Fork 27
62 lines (59 loc) · 1.93 KB
/
Copy pathgo.yml
File metadata and controls
62 lines (59 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Go
on:
push:
branches: [master]
paths:
- "go/**"
pull_request:
paths:
- "go/**"
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_GO }}
LAUNCHABLE_DEBUG: 1
LAUNCHABLE_REPORT_ERROR: 1
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
go-junit-report-version: [
"github.com/jstemmer/go-junit-report@latest", # v1
"github.com/jstemmer/go-junit-report/v2@latest", # v2
]
defaults:
run:
working-directory: go
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools_scm
pip install launchable
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Install dependencies
run: |
go install ${{ matrix.go-junit-report-version }}
- run: "launchable verify"
- name: Record commits and build
run: 'launchable record build --name "$GITHUB_RUN_ID" --source ..' # care for working-directory path
- name: Record session
run: |
launchable record session --build "$GITHUB_RUN_ID" --flavor go-version=${{ matrix.go-version }} --flavor go-junit-report-version=${{ matrix.go-junit-report-version }} > session.txt
- name: Subset
run: go test -list="Test|Example" ./... | launchable subset --session $(cat session.txt) --confidence 80% go-test > launchable-subset.txt
- name: Test
run: |
go test -run $(cat launchable-subset.txt) ./... -v 2>&1 | go-junit-report -set-exit-code > report.xml
cat report.xml
- name: Record
run: launchable record tests --session $(cat session.txt) go-test report.xml
if: always()