Skip to content

Commit 9107f2f

Browse files
committed
Selective startup
1 parent 617cf69 commit 9107f2f

2 files changed

Lines changed: 39 additions & 37 deletions

File tree

.github/workflows/tests.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,39 @@ jobs:
6464
run: docker compose exec tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4 /usr/src/code/tests/unit
6565

6666
adapter_test:
67-
name: Adapter Tests
67+
name: "Adapter Tests (${{ matrix.adapter }})"
6868
runs-on: ubuntu-latest
6969
needs: setup
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
adapter:
74-
[
75-
MongoDB,
76-
MariaDB,
77-
MySQL,
78-
Postgres,
79-
SQLite,
80-
Mirror,
81-
Pool,
82-
SharedTables/MongoDB,
83-
SharedTables/MariaDB,
84-
SharedTables/MySQL,
85-
SharedTables/Postgres,
86-
SharedTables/SQLite,
87-
Schemaless/MongoDB,
88-
]
73+
include:
74+
- adapter: MongoDB
75+
profiles: "--profile mongo"
76+
- adapter: MariaDB
77+
profiles: "--profile mariadb"
78+
- adapter: MySQL
79+
profiles: "--profile mysql"
80+
- adapter: Postgres
81+
profiles: "--profile postgres"
82+
- adapter: SQLite
83+
profiles: ""
84+
- adapter: Mirror
85+
profiles: "--profile mariadb --profile mariadb-mirror --profile redis-mirror"
86+
- adapter: Pool
87+
profiles: "--profile mysql"
88+
- adapter: SharedTables/MongoDB
89+
profiles: "--profile mongo"
90+
- adapter: SharedTables/MariaDB
91+
profiles: "--profile mariadb"
92+
- adapter: SharedTables/MySQL
93+
profiles: "--profile mysql"
94+
- adapter: SharedTables/Postgres
95+
profiles: "--profile postgres"
96+
- adapter: SharedTables/SQLite
97+
profiles: ""
98+
- adapter: Schemaless/MongoDB
99+
profiles: "--profile mongo"
89100

90101
steps:
91102
- name: checkout
@@ -101,7 +112,7 @@ jobs:
101112
- name: Load and Start Services
102113
run: |
103114
docker load --input /tmp/${{ env.IMAGE }}.tar
104-
docker compose up -d --wait
115+
docker compose ${{ matrix.profiles }} up -d --wait
105116
106117
- name: Run Tests
107118
run: docker compose exec -T tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4 /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php

docker-compose.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,11 @@ services:
2020
- ./docker-compose.yml:/usr/src/code/docker-compose.yml
2121
environment:
2222
PHP_IDE_CONFIG: serverName=tests
23-
depends_on:
24-
postgres:
25-
condition: service_healthy
26-
postgres-mirror:
27-
condition: service_healthy
28-
mariadb:
29-
condition: service_healthy
30-
mariadb-mirror:
31-
condition: service_healthy
32-
mysql:
33-
condition: service_healthy
34-
mysql-mirror:
35-
condition: service_healthy
36-
redis:
37-
condition: service_healthy
38-
redis-mirror:
39-
condition: service_healthy
40-
mongo:
41-
condition: service_healthy
4223

4324
adminer:
4425
image: adminer
4526
container_name: utopia-adminer
27+
profiles: [debug]
4628
restart: always
4729
ports:
4830
- "8700:8080"
@@ -56,6 +38,7 @@ services:
5638
args:
5739
POSTGRES_VERSION: 16
5840
container_name: utopia-postgres
41+
profiles: [postgres]
5942
networks:
6043
- database
6144
ports:
@@ -78,6 +61,7 @@ services:
7861
args:
7962
POSTGRES_VERSION: 16
8063
container_name: utopia-postgres-mirror
64+
profiles: [postgres-mirror]
8165
networks:
8266
- database
8367
ports:
@@ -96,6 +80,7 @@ services:
9680
mariadb:
9781
image: mariadb:10.11
9882
container_name: utopia-mariadb
83+
profiles: [mariadb]
9984
command: mariadbd --max_allowed_packet=1G
10085
networks:
10186
- database
@@ -113,6 +98,7 @@ services:
11398
mariadb-mirror:
11499
image: mariadb:10.11
115100
container_name: utopia-mariadb-mirror
101+
profiles: [mariadb-mirror]
116102
command: mariadbd --max_allowed_packet=1G
117103
networks:
118104
- database
@@ -130,6 +116,7 @@ services:
130116
mongo:
131117
image: mongo:8.0.14
132118
container_name: utopia-mongo
119+
profiles: [mongo]
133120
entrypoint: ["/entrypoint.sh"]
134121
networks:
135122
- database
@@ -162,6 +149,7 @@ services:
162149
mongo-express:
163150
image: mongo-express
164151
container_name: mongo-express
152+
profiles: [debug]
165153
depends_on:
166154
mongo:
167155
condition: service_healthy
@@ -177,6 +165,7 @@ services:
177165
mysql:
178166
image: mysql:8.0.43
179167
container_name: utopia-mysql
168+
profiles: [mysql]
180169
networks:
181170
- database
182171
ports:
@@ -199,6 +188,7 @@ services:
199188
mysql-mirror:
200189
image: mysql:8.0.43
201190
container_name: utopia-mysql-mirror
191+
profiles: [mysql-mirror]
202192
networks:
203193
- database
204194
ports:
@@ -236,6 +226,7 @@ services:
236226
redis-mirror:
237227
image: redis:8.2.1-alpine3.22
238228
container_name: utopia-redis-mirror
229+
profiles: [redis-mirror]
239230
restart: always
240231
ports:
241232
- "8709:6379"

0 commit comments

Comments
 (0)