forked from holistics/dbml
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (127 loc) · 3.76 KB
/
Copy pathtest.yml
File metadata and controls
129 lines (127 loc) · 3.76 KB
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
name: Run unit test & coverage
on:
push:
branches: [master]
paths-ignore:
- "dbml-homepage/**"
pull_request:
branches: [master]
types: [opened, synchronize]
paths-ignore:
- "dbml-homepage/**"
jobs:
build:
runs-on: blacksmith-2vcpu-ubuntu-2204
timeout-minutes: 20
strategy:
matrix:
node-version: [22.x]
services:
postgres:
image: postgres:15-bullseye
env:
POSTGRES_USER: dbml
POSTGRES_PASSWORD: testtest
POSTGRES_DB: dbml_test
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: dbml.123.123
ports:
- 1433:1433
options: >-
--health-cmd "exit 0"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql-8.0:
image: mysql:8.0
env:
MYSQL_DATABASE: dbml_test
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 10
oracle:
image: gvenzl/oracle-xe:21-slim-faststart
env:
ORACLE_PASSWORD: root
ORACLE_DATABASE: dbml_test
APP_USER: dbml
APP_USER_PASSWORD: root
ports:
- 1521:1521
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Setup Oracle Instant Client
uses: iamazeem/setup-oracle-instant-client-action@v2
- uses: actions/checkout@v3
- name: Import DDL to Postgres
run: |
psql -h localhost -U dbml -d dbml_test -f packages/dbml-cli/__tests__/db2dbml/postgres/schema.sql
env:
PGPASSWORD: testtest
- name: Import DDL to MySQL
run: |
mysql -h 127.0.0.1 -u root -proot dbml_test < packages/dbml-cli/__tests__/db2dbml/mysql/schema.sql
- name: Import DDL to MSSQL
run: |
sqlcmd -S localhost -U sa -P dbml.123.123 -d master -i packages/dbml-cli/__tests__/db2dbml/mssql/schema.sql
- name: Import DDL to Oracle
run: |
sqlplus -s dbml/root@localhost:1521/dbml_test @packages/dbml-cli/__tests__/db2dbml/oracle/schema.sql
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build packages
run: NODE_OPTIONS="--max-old-space-size=8192" yarn build
- name: Run coverage test
run: yarn coverage
- name: Generate coverage report
id: coverage
run: node .github/workflows/scripts/collect-coverage.js
- name: Upload coverage test
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report.md
path: ./coverage-report.md
include-hidden-files: true
comment-coverage:
runs-on: blacksmith-2vcpu-ubuntu-2204
timeout-minutes: 5
continue-on-error: true
needs: build
steps:
- name: Download test coverage
uses: actions/download-artifact@v4
with:
name: coverage-report.md
path: ./coverage-report.md
- name: Comment PR with coverage report
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: ./coverage-report.md