-
-
Notifications
You must be signed in to change notification settings - Fork 588
114 lines (96 loc) · 3.13 KB
/
e2e.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
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: E2E test
on:
push:
branches:
- '**'
paths-ignore:
- 'benchmark/**'
- 'dev/**'
- 'examples/**'
- '*.md'
pull_request:
branches:
- master
paths-ignore:
- 'benchmark/**'
- 'dev/**'
- 'examples/**'
- '*.md'
jobs:
test:
runs-on: ubuntu-latest
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
strategy:
matrix:
node-version: [16.x]
transporter: [NATS, Redis, MQTT, AMQP, AMQP10, Kafka, TCP]
serializer: [JSON, JSONExt, MsgPack, Notepack, CBOR]
discoverer: [Local, Etcd3, Redis]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }} with ${{ matrix.transporter }} transporter and ${{ matrix.serializer }} and ${{ matrix.discoverer }} discoverer
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Start NATS
run: docker-compose up -d nats && sleep 10
if: ${{ matrix.transporter == 'NATS' }}
working-directory: ./test
- name: Start Redis
run: docker-compose up -d redis && sleep 10
if: ${{ matrix.transporter == 'Redis' || matrix.discoverer == 'Redis' }}
working-directory: ./test
- name: Start MQTT
run: docker-compose up -d mqtt && sleep 10
if: ${{ matrix.transporter == 'MQTT' }}
working-directory: ./test
- name: Start RabbitMQ
run: docker-compose up -d rabbitmq && sleep 10
if: ${{ matrix.transporter == 'AMQP' }}
working-directory: ./test
- name: Start ActiveMQ
run: docker-compose up -d activemq && sleep 30
if: ${{ matrix.transporter == 'AMQP10' }}
working-directory: ./test
- name: Start Kafka
run: docker-compose up -d zookeeper kafka && sleep 60
if: ${{ matrix.transporter == 'Kafka' }}
working-directory: ./test
- name: Start Etcd3
run: docker-compose up -d etcd3 && sleep 10
if: ${{ matrix.discoverer == 'Etcd3' }}
working-directory: ./test
- name: Check containers
run: docker-compose ps
working-directory: ./test
- name: Check logs
run: docker-compose logs
working-directory: ./test
- name: Execute E2E tests
run: npm run test:e2e
timeout-minutes: 5
env:
TRANSPORTER: ${{ matrix.transporter }}
SERIALIZER: ${{ matrix.serializer }}
DISCOVERER: ${{ matrix.discoverer }}
# LOGLEVEL: "${{ matrix.transporter == 'Kafka' && 'debug' || 'warn' }}"
- name: Stop containers
run: docker-compose down -v
working-directory: ./test