-
Notifications
You must be signed in to change notification settings - Fork 5
174 lines (139 loc) · 4.66 KB
/
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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI
on: push
jobs:
build:
name: 'Unit Test and Build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Build
run: npm run build
# - name: Run sync-database-models command
# id: sync
# run: npm exec sync-database-models
- name: Run tests
run: npm test
test_postgre:
name: 'Postgres Connection'
runs-on: ubuntu-latest
needs: build
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: 123456
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: postgres
POSTGRES_HOST: localhost
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123456
POSTGRES_PORT: 5432
POSTGRES_DEFAULT_SCHEMA: public
run: npm run test:connection
test_mysql:
name: 'MySQL Connection'
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
version: ['5.7', '8.0']
services:
mysql:
image: mysql:${{ matrix.version }}
env:
MYSQL_DATABASE: testdb
MYSQL_ROOT_PASSWORD: 123456
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: mysql
MYSQL_HOST: localhost
MYSQL_DB: testdb
MYSQL_USER: root
MYSQL_PASSWORD: 123456
MYSQL_PORT: 3306
MYSQL_DEFAULT_SCHEMA: testdb
run: npm run test:connection
test_bigquery:
name: 'BigQuery Connection'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: bigquery
BIGQUERY_PROJECT_ID: ${{ secrets.BIGQUERY_PROJECT_ID }}
BIGQUERY_CLIENT_EMAIL: ${{ secrets.BIGQUERY_CLIENT_EMAIL }}
BIGQUERY_PRIVATE_KEY: ${{ secrets.BIGQUERY_PRIVATE_KEY }}
BIGQUERY_DEFAULT_SCHEMA: ${{ secrets.BIGQUERY_DEFAULT_SCHEMA }}
run: npm run test:connection
test_turso:
name: 'Turso Connection'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: turso
run: npm run test:connection
test_cloudflare:
name: 'Cloudflare D1 Connection'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: cloudflare
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_DATABASE_ID: ${{ secrets.CLOUDFLARE_DATABASE_ID }}
run: npm run test:connection
test_mongodb:
name: 'MongoDB Connection'
runs-on: ubuntu-latest
needs: build
services:
mongodb:
image: mongo
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run tests
env:
CONNECTION_TYPE: mongodb
MONGODB_URI: mongodb://localhost:27017
MONGODB_DB_NAME: testing
run: npm run test:connection