-
Notifications
You must be signed in to change notification settings - Fork 28
77 lines (69 loc) · 2.01 KB
/
run-e2e-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
75
76
77
name: e2e Tests
on: [pull_request]
jobs:
run-e2e-tests:
name: Run e2e Tests
runs-on: ubuntu-latest
services:
mysql:
image: bitnami/mysql
env:
MYSQL_DATABASE: app
MYSQL_USER: docker
MYSQL_PASSWORD: docker
MYSQL_ROOT_PASSWORD: toor
ports:
- 3306:3306
volumes:
- mysql:/var/lib/mysql
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=10
zookeeper:
image: bitnami/zookeeper:3
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
options: >-
--health-cmd "nc -z localhost 2181 || exit -1"
--health-interval 10s
--health-timeout 5s
--health-retries 10
kafka:
image: bitnami/kafka:2
ports:
- 9092:9092
env:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_ADVERTISED_HOST_NAME: localhost
options: >-
--health-cmd "kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --list"
--health-interval 10s
--health-timeout 10s
--health-retries 50
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies (with cache)
uses: bahmutov/npm-install@v1
- name: Run Tests
run: yarn test:e2e
env:
DATABASE_HOST: localhost
DATABASE_PORT: ${{ job.services.mysql.ports[3306] }}
DATABASE_USER: root
DATABASE_PASS: toor
JWT_PUBLIC_KEY: ${{secrets.JWT_DUMMY_PUBLIC}}
JWT_SECRET_KEY: ${{secrets.JWT_DUMMY_PRIVATE}}