-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (137 loc) · 4.91 KB
/
Copy pathtests.yml
File metadata and controls
147 lines (137 loc) · 4.91 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
name: Tests
on:
workflow_dispatch:
inputs:
couchbase-server-version:
description: 'Couchbase Server version to test against'
type: choice
required: false
default: 'all'
options:
- 'all'
- 'enterprise-7.2.4'
- 'enterprise-7.6.4'
- 'enterprise-8.0.0'
push:
branches:
- main
# Evaluated against the diff of the *whole push*, not just its head commit, so a
# push mixing `docs(…)` and code commits still runs. A push that touches nothing
# but these paths creates no run at all. `[skip ci]` in a commit message is
# honoured natively, on top of this.
paths-ignore:
- 'docs/**'
- 'assets/**'
- '**/*.md'
- 'LICENSE'
- 'NOTICE'
- 'latest-upstream-commit'
issue_comment:
types: [created]
jobs:
test:
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/test') &&
github.actor == 'JesusTheHun')
timeout-minutes: 30
runs-on:
labels: blacksmith-4vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
couchbase-server-version: ${{ github.event_name == 'workflow_dispatch' && inputs.couchbase-server-version != 'all' && fromJSON(format('["{0}"]', inputs.couchbase-server-version)) || fromJSON('["enterprise-7.2.4","enterprise-7.6.4","enterprise-8.0.0"]') }}
services:
couchbase:
image: couchbase:${{ matrix.couchbase-server-version }}
ports:
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 8095:8095
- 8096:8096
- 8097:8097
- 9102:9102
- 18091:18091
- 18092:18092
- 18093:18093
- 18094:18094
- 18095:18095
- 18096:18096
- 18097:18097
- 19102:19102
- 9123:9123
- 11210:11210
- 11280:11280
env:
CB_CONNECTION_STRING: couchbase://127.0.0.1
CB_USER: Administrator
CB_PASSWORD: password
steps:
# `/test` on a pull request must check out the PR, not the default branch.
# An empty `ref` is checkout's own default, so push and dispatch are unchanged.
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || '' }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm i
- name: Build packages
run: pnpm run build
- name: Initialize Couchbase cluster
run: pnpm dlx tsx tests/scripts/initTestCluster.ts
- name: Restore vitest cache
uses: actions/cache/restore@v5
with:
path: ./node_modules/.vite/results.json
key: vitest-cache-${{ matrix.couchbase-server-version }}-${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
vitest-cache-${{ matrix.couchbase-server-version }}-${{ github.ref_name }}-
vitest-cache-${{ matrix.couchbase-server-version }}-main-
- name: Run all tests
run: pnpm vitest --run --bail 5
# A vitest worker dying is reported as `[vitest-pool]: Worker forks emitted error`,
# without the exit code nor the signal. A segfault of the native addon and a kernel
# OOM kill both look the same from vitest, but not from the kernel ring buffer.
- name: Diagnose worker deaths
if: always()
run: |
echo "::group::kernel ring buffer"
sudo dmesg -T | tail -300 || true
echo "::endgroup::"
echo "::group::memory"
free -m || true
echo "::endgroup::"
echo "::group::core dumps"
cat /proc/sys/kernel/core_pattern || true
ls -la /var/lib/systemd/coredump 2>/dev/null || true
coredumpctl list --no-pager 2>/dev/null || true
echo "::endgroup::"
- name: Save vitest cache
if: always()
uses: actions/cache/save@v5
with:
path: ./node_modules/.vite/results.json
key: vitest-cache-${{ matrix.couchbase-server-version }}-${{ github.ref_name }}-${{ github.run_id }}-${{ github.run_attempt }}
- name: Upload Tests Report
if: always()
uses: actions/upload-artifact@v7
with:
name: tests-report-${{ matrix.couchbase-server-version }}-${{ github.sha }}
path: tests-report
overwrite: true
- name: Upload Tests Logs
if: always()
uses: actions/upload-artifact@v7
with:
name: tests-logs-${{ matrix.couchbase-server-version }}-${{ github.sha }}
path: vitest-pino.log
overwrite: true