-
Notifications
You must be signed in to change notification settings - Fork 26
76 lines (66 loc) · 2.1 KB
/
integration-test.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
name: Integration Tests
on:
pull_request:
branches: [dev, main]
jobs:
integration-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.39
env:
MYSQL_ROOT_PASSWORD: userfeedback
MYSQL_DATABASE: e2e
MYSQL_USER: userfeedback
MYSQL_PASSWORD: userfeedback
TZ: UTC
ports:
- 13307:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
smtp:
image: rnwood/smtp4dev:v3
ports:
- 5080:80
- 25:25
- 143:143
opensearch:
image: opensearchproject/opensearch:2.17.1
env:
discovery.type: single-node
bootstrap.memory_lock: "true"
plugins.security.disabled: "true"
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "UserFeedback123!@#"
options: >-
--health-cmd="curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"'"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
- 9200:9200
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup integration test (with opensearch)
run: |
npx corepack enable
pnpm install --frozen-lockfile
pnpm build
echo "BASE_URL=http://localhost:3000" >> ./apps/api/.env
echo "JWT_SECRET=DEV" >> ./apps/api/.env
echo "OPENSEARCH_USE=true" >> ./apps/api/.env
echo "OPENSEARCH_NODE=http://localhost:9200" >> ./apps/api/.env
echo "OPENSEARCH_USERNAME=''" >> ./apps/api/.env
echo "OPENSEARCH_PASSWORD=''" >> ./apps/api/.env
- name: Run integration tests (with opensearch)
run: |
npm run test:integration
- name: Setup integration test (without opensearch)
run: |
echo "OPENSEARCH_USE=false" >> ./apps/api/.env
- name: Run integration tests (without opensearch)
run: |
npm run test:integration