Skip to content

Commit e0a4f32

Browse files
committed
ci: add database selection
1 parent 495646d commit e0a4f32

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/docker-e2e.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,25 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
# <database-relational-block>
1617
- name: Run e2e tests for NestJS with TypeORM
1718
id: relational
1819
run: docker compose -f docker-compose.relational.ci.yaml --env-file env-example-relational -p ci-relational up --build --exit-code-from api
1920

2021
- name: Copy prod.log from container to host
2122
if: ${{ failure() && steps.relational.conclusion == 'failure' }}
2223
run: docker cp ci-relational-api-1:/usr/src/app/prod.log .
24+
# </database-relational-block>
2325

26+
# <database-document-block>
2427
- name: Run e2e tests for NestJS with Mongoose
2528
id: document
2629
run: docker compose -f docker-compose.document.ci.yaml --env-file env-example-document -p ci-document up --build --exit-code-from api
2730

2831
- name: Copy prod.log from container to host
2932
if: ${{ failure() && steps.document.conclusion == 'failure' }}
3033
run: docker cp ci-document-api-1:/usr/src/app/prod.log .
34+
# </database-document-block>
3135

3236
- name: Upload prod.log to artifacts for debugging
3337
if: failure()

.install-scripts/scripts/remove-mongodb.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ const removeMongoDb = async () => {
6767
),
6868
];
6969

70+
replace({
71+
path: path.join(process.cwd(), '.github', 'workflows', 'docker-e2e.yml'),
72+
actions: [
73+
{
74+
find: /\# <database-document-block>.*\# <\/database-document-block>/gs,
75+
replace: '',
76+
},
77+
],
78+
});
7079
replace({
7180
path: path.join(process.cwd(), 'src', 'app.module.ts'),
7281
actions: [

.install-scripts/scripts/remove-postgresql.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ const removePostgreSql = async () => {
6262
path.join(process.cwd(), 'src', 'utils', 'relational-entity-helper.ts'),
6363
];
6464

65+
replace({
66+
path: path.join(process.cwd(), '.github', 'workflows', 'docker-e2e.yml'),
67+
actions: [
68+
{
69+
find: /\# <database-relational-block>.*\# <\/database-relational-block>/gs,
70+
replace: '',
71+
},
72+
],
73+
});
6574
replace({
6675
path: path.join(process.cwd(), 'src', 'app.module.ts'),
6776
actions: [

0 commit comments

Comments
 (0)