-
Notifications
You must be signed in to change notification settings - Fork 24
245 lines (243 loc) · 7.21 KB
/
specs.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: Specs
on:
push:
branches:
- "*"
- "*/*"
pull_request:
branches:
- "*"
- "*/*"
schedule:
- cron: '0 0 * * *'
jobs:
mariadb:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:${{ matrix.db_version }}
env:
MARIADB_ROOT_PASSWORD: "mariadb"
MARIADB_DATABASE: marten_test
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh
--connect
--innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
continue-on-error: ${{ matrix.crystal == 'nightly' }}
strategy:
fail-fast: false
matrix:
db_version: ['10.11.6', '11.2.2']
crystal: [
'1.11.2',
'1.12.2',
'1.13.1',
'nightly',
]
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
- uses: actions/checkout@v2
- name: Install packages required for MySQL
run: |
apt-get update
apt-get -yqq install mysql-client libmysqlclient-dev
- name: Create additional DB for MySQL
run: |
mysql -u root -h mariadb --password=mariadb -e 'create database marten_other_test;'
env:
PGPASSWORD: mysql
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Setup env JSON file
run: cp .spec.env.json.ci .spec.env.json
- name: Run tests
run: scripts/run_batched_specs
env:
MARTEN_SPEC_DB_CONNECTION: mariadb
mysql:
runs-on: ubuntu-latest
services:
mysql:
image: bitnami/mysql:8.3.0
env:
MYSQL_ROOT_PASSWORD: "mysql"
MYSQL_DATABASE: marten_test
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 3307:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
continue-on-error: ${{ matrix.crystal == 'nightly' }}
strategy:
fail-fast: false
matrix:
crystal: [
'1.11.2',
'1.12.2',
'1.13.1',
'nightly',
]
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
- uses: actions/checkout@v2
- name: Install packages required for MySQL
run: |
apt-get update
apt-get -yqq install mysql-client libmysqlclient-dev
- name: Create additional DB for MySQL
run: |
mysql -u root -h mysql --password=mysql -e 'create database marten_other_test;'
env:
PGPASSWORD: mysql
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Setup env JSON file
run: cp .spec.env.json.ci .spec.env.json
- name: Run tests
run: scripts/run_batched_specs
env:
MARTEN_SPEC_DB_CONNECTION: mysql
postgresql:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:${{ matrix.db_version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: marten_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
continue-on-error: ${{ matrix.crystal == 'nightly' }}
strategy:
fail-fast: false
matrix:
db_version: ['14', '15', '16']
crystal: [
'1.11.2',
'1.12.2',
'1.13.1',
'nightly',
]
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
- uses: actions/checkout@v2
- name: Install packages required for PostgreSQL
run: |
apt-get update
apt-get -yqq install libpq-dev postgresql-client libsqlite3-dev
- name: Create additional DB for PostgreSQL
run: |
createdb marten_other_test -h postgres -U postgres
env:
PGPASSWORD: postgres
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Setup env JSON file
run: cp .spec.env.json.ci .spec.env.json
- name: Run tests
run: scripts/run_batched_specs
env:
MARTEN_SPEC_DB_CONNECTION: postgresql
sqlite:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.crystal == 'nightly' }}
strategy:
fail-fast: false
matrix:
crystal: [
'1.11.2',
'1.12.2',
'1.13.1',
'nightly',
]
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
- uses: actions/checkout@v2
- name: Install packages required for SQLite
run: |
apt-get update
apt-get -yqq install libsqlite3-dev
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Setup env JSON file
run: cp .spec.env.json.ci .spec.env.json
- name: Run tests
run: scripts/run_batched_specs
generated-auth-project:
runs-on: ubuntu-latest
strategy:
fail-fast: false
container:
image: crystallang/crystal:1.13.1
steps:
- uses: actions/checkout@v2
- name: Install packages required for SQLite
run: |
apt-get update
apt-get -yqq install libsqlite3-dev
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Build the Marten CLI
run: |
mkdir bin
crystal build src/marten_cli.cr -o bin/marten
- name: Generate a project with authentication
run: |
mkdir tmp
bin/marten new project test-auth --with-auth --dir=./tmp/test-auth
- name: Install generated project dependencies
run: |
cd tmp/test-auth
shards install --ignore-crystal-version --skip-postinstall --skip-executables
cd lib && rm -rf marten && ln -s ../../.. marten
- name: Run generated project tests
run: cd tmp/test-auth && crystal spec
generated-auth-app:
runs-on: ubuntu-latest
strategy:
fail-fast: false
container:
image: crystallang/crystal:1.13.1
steps:
- uses: actions/checkout@v2
- name: Install packages required for SQLite
run: |
apt-get update
apt-get -yqq install libsqlite3-dev
- name: Install shards
run: shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Build the Marten CLI
run: |
mkdir bin
crystal build src/marten_cli.cr -o bin/marten
- name: Generate a project with authentication
run: |
mkdir tmp
bin/marten new project test-auth --dir=./tmp/test-auth
- name: Install generated project dependencies
run: |
cd tmp/test-auth
shards install --ignore-crystal-version --skip-postinstall --skip-executables
cd lib && rm -rf marten && ln -s ../../.. marten
cd .. && crystal run manage.cr -- g auth my_auth
shards install --ignore-crystal-version --skip-postinstall --skip-executables
- name: Run generated project tests
run: cd tmp/test-auth && crystal spec