-
Notifications
You must be signed in to change notification settings - Fork 45
63 lines (48 loc) · 1.61 KB
/
docker.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
name: Test with Docker
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
# transporter: [NATS, Redis, MQTT, AMQP, AMQP10, STAN, Kafka, TCP]
transporter: [NATS, Redis, MQTT, AMQP, STAN, Kafka, TCP]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }} with ${{ matrix.transporter }} transporter
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm i
- name: Create answers file
run: node update-answers.js
working-directory: ./test/ci
env:
TRANSPORTER: ${{ matrix.transporter }}
- name: Generate project with '${{ matrix.transporter }}' transporter
run: npm test
- name: Run tests in the generated project
run: npm test
working-directory: ./ci-test
- run: cat ./ci-test/docker-compose.env
- run: cat ./ci-test/docker-compose.yml
- name: Start containers
run: npm run dc:up
working-directory: ./ci-test
- name: Sleeping 30 secs
run: sleep 30
- name: Check containers
run: docker-compose ps
working-directory: ./ci-test
- run: curl --silent --show-error --fail http://localhost:3000/api/greeter/hello
- run: curl --silent --show-error --fail http://localhost:3000/api/products
- name: Check logs
run: docker-compose logs
working-directory: ./ci-test
if: failure()
- name: Stop containers
run: npm run dc:down
working-directory: ./ci-test