-
Notifications
You must be signed in to change notification settings - Fork 22
74 lines (66 loc) · 2.32 KB
/
tests.yml
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
name: tests workflow
on:
workflow_call:
inputs:
version:
required: true
type: string
secrets:
eventstore_cloud_id:
required: false
tailscale_auth:
required: false
jobs:
build-and-test:
name: "${{ matrix.group.name }}"
strategy:
fail-fast: false
matrix:
group:
- name: samples
path: ./src/samples
tailscale: true
- name: connection
path: ./src/connection
tailscale: true
- name: extra
path: ./src/extra
- name: persistentSubscription
path: ./src/persistentSubscription
- name: projections
path: ./src/projections
- name: streams
path: ./src/streams
- name: opentelemetry
path: ./src/opentelemetry
env:
# Github only passes secrets to the main repo, so we need to skip some things if they are unavailable
SECRETS_AVAILABLE: ${{ secrets.eventstore_cloud_id != null }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Connect to tailscale
if: ${{ matrix.group.tailscale && env.SECRETS_AVAILABLE == 'true' }}
run: |
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/eoan.gpg | sudo apt-key add -
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/eoan.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt-get update
sudo apt-get install tailscale
sudo tailscale up --authkey ${{ secrets.tailscale_auth }} --hostname "node-client-ci-${{ inputs.version }}-$(date +'%Y-%m-%d-%H-%M-%S')" --advertise-tags=tag:ci --accept-routes
- uses: actions/setup-node@v4
with:
node-version-file: .github/files/.nvmrc
- name: NodeJS version
run: node -v
- name: Install
run: yarn
- name: Build
run: yarn build
- name: Run Tests
run: yarn test ${{ matrix.group.path }} --ci --run-in-band --forceExit
env:
EVENTSTORE_IMAGE: eventstore-ce:${{ inputs.version }}
EVENTSTORE_CLOUD_ID: ${{ secrets.eventstore_cloud_id }}
- name: Disconnect from tailscale
if: ${{ always() && matrix.group.tailscale && env.SECRETS_AVAILABLE == 'true' }}
run: sudo tailscale down