-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (105 loc) · 3.53 KB
/
tests.yml
File metadata and controls
114 lines (105 loc) · 3.53 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
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
issue_comment:
types: [created]
jobs:
test:
if: >
(github.event_name == 'push'
&& !contains(github.event.head_commit.message, 'skip ci')
&& !startsWith(github.event.head_commit.message, 'docs')) ||
(github.event.issue.pull_request && startsWith(github.event.comment.body, '/test') && github.actor == 'JesusTheHun') ||
github.event_name == 'workflow_dispatch'
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:
- uses: actions/checkout@v6
- 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
- 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