-
Notifications
You must be signed in to change notification settings - Fork 26
150 lines (127 loc) · 4.01 KB
/
Copy pathtest.yml
File metadata and controls
150 lines (127 loc) · 4.01 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Test
permissions: {}
on:
push:
branches:
- master
- v10.*
pull_request:
branches:
- master
- v10.*
workflow_dispatch:
inputs:
go-version:
description: 'Go version to use for testing.'
required: false
minimum-go-version:
description: 'Minimum Go version supported by the SDK.'
required: false
ref:
description: 'The branch, tag or SHA to checkout.'
required: false
jobs:
mock-test:
name: Mock Tests
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
- windows-2025-vs2026
- windows-11-arm
- macos-26-intel
- macos-26
go-version:
- &go-version ${{ inputs.go-version || '1.26' }}
include:
- runner: ubuntu-24.04
go-version: ${{ inputs.minimum-go-version || '1.21' }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: false
- name: Run tests
id: run-tests
shell: bash
run: |
# gotestsum v1.13.0 requires Go 1.24+
GOTESTSUM_VERSION=v1.13.0
GO_VERSION="$(go version | awk '{print $3}')"
if [[ "$(printf '%s\n' "$GO_VERSION" go1.24 | sort -V | head -n1)" != "go1.24" ]]; then
GOTESTSUM_VERSION=v1.12.2
fi
go install gotest.tools/gotestsum@$GOTESTSUM_VERSION
# The race detector is not supported on windows/arm64
RACE="-race"
if [[ "$RUNNER_OS" == "Windows" && "$RUNNER_ARCH" == "ARM64" ]]; then
RACE=""
fi
gotestsum --format standard-verbose --junitfile TEST-report.xml -- -v $RACE ./
- name: Publish test results
shell: bash
if: ${{ !cancelled() }}
run: |
curl https://raw.githubusercontent.com/couchbaselabs/junit-markdown/refs/heads/main/JunitMarkdown.java --output "$RUNNER_TEMP/JunitMarkdown.java"
java "$RUNNER_TEMP/JunitMarkdown.java" --format=passthrough . >> $GITHUB_STEP_SUMMARY
integration-test:
name: Integration Tests
strategy:
fail-fast: false
matrix:
server:
- 8.5-stable
- 8.0-stable
- 8.0-release
- 7.6-stable
- 7.6-release
- 7.2-release
suite:
- standard
- dcp
runs-on: ubuntu-24.04
permissions:
packages: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-go@v6
with:
go-version: *go-version
cache: false
- name: Resolve server version
uses: couchbaselabs/sdk-resolve-cb-alias-action@v1
id: resolve-server
with:
alias: ${{ matrix.server }}
- name: Create cluster
uses: ./.github/actions/create-cluster
id: create-cluster
with:
version: ${{ steps.resolve-server.outputs.version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
id: run-tests
shell: bash
run: |
go install gotest.tools/gotestsum@v1.13.0
gotestsum --format standard-verbose --junitfile TEST-report.xml -- -v -race ./
env:
GCBCONNSTR: ${{ steps.create-cluster.outputs.connstr }}
GCBUSER: Administrator
GCBPASS: password
GCBCVER: ${{ steps.resolve-server.outputs.version }}
GCBCTESTSUITE: ${{ matrix.suite == 'dcp' && 2 || 1 }}
- name: Publish test results
shell: bash
if: ${{ !cancelled() }}
run: |
curl https://raw.githubusercontent.com/couchbaselabs/junit-markdown/refs/heads/main/JunitMarkdown.java --output "$RUNNER_TEMP/JunitMarkdown.java"
java "$RUNNER_TEMP/JunitMarkdown.java" --format=passthrough . >> $GITHUB_STEP_SUMMARY