Skip to content

Commit ffd070d

Browse files
its-monotypeShchepotin
authored andcommitted
ci: upload artifact with prod logs on e2e failure
1 parent cb5375a commit ffd070d

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/workflows/docker-e2e.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,26 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
1516
- name: Run e2e tests for NestJS with TypeORM
17+
id: relational
1618
run: docker compose -f docker-compose.relational.ci.yaml --env-file env-example-relational -p ci-relational up --build --exit-code-from api
19+
20+
- name: Copy prod.log from container to host
21+
if: ${{ failure() && steps.relational.conclusion == 'failure' }}
22+
run: docker cp ci-relational-api-1:/usr/src/app/prod.log .
23+
1724
- name: Run e2e tests for NestJS with Mongoose
25+
id: document
1826
run: docker compose -f docker-compose.document.ci.yaml --env-file env-example-document -p ci-document up --build --exit-code-from api
27+
28+
- name: Copy prod.log from container to host
29+
if: ${{ failure() && steps.document.conclusion == 'failure' }}
30+
run: docker cp ci-document-api-1:/usr/src/app/prod.log .
31+
32+
- name: Upload prod.log to artifacts for debugging
33+
if: failure()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: prod-logs
37+
path: prod.log

startup.document.ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
/opt/wait-for-it.sh mongo:27017
55
npm run seed:run:document
6-
npm run start:prod > /dev/null 2>&1 &
6+
npm run start:prod > prod.log 2>&1 &
77
/opt/wait-for-it.sh maildev:1080
88
/opt/wait-for-it.sh localhost:3000
99
npm run lint

startup.relational.ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
/opt/wait-for-it.sh postgres:5432
55
npm run migration:run
66
npm run seed:run:relational
7-
npm run start:prod > /dev/null 2>&1 &
7+
npm run start:prod > prod.log 2>&1 &
88
/opt/wait-for-it.sh maildev:1080
99
/opt/wait-for-it.sh localhost:3000
1010
npm run lint

0 commit comments

Comments
 (0)