-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert: "chore: don't run database container with docker compose"
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,16 +27,20 @@ jobs: | |
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations | ||
include: | ||
# "docker-service-name" must match "services.$name" from docker-compose.yaml | ||
# "database-service-name" must match "services.$name" from docker-compose.yaml | ||
# "application-port" must match "services.$name.environment:PORT" from docker-compose.yaml | ||
- docker-service-name: 'express-js' | ||
database-service-name: 'mysql' | ||
application-port: 3010 | ||
- docker-service-name: 'express-ts' | ||
database-service-name: 'mysql' | ||
application-port: 3020 | ||
- docker-service-name: 'chi' | ||
database-service-name: 'mysql' | ||
application-port: 3030 | ||
env: | ||
# Prevent interference between builds by setting the project name to a unique value. Otherwise | ||
# "docker compose down" has been stopping containers from other builds. | ||
# "docker compose down" has been stopping containers (especially database) from other builds. | ||
# https://docs.docker.com/compose/project-name/ | ||
# https://docs.docker.com/compose/environment-variables/envvars/#compose_project_name | ||
COMPOSE_PROJECT_NAME: ${{ matrix.docker-service-name }} | ||
|
@@ -74,7 +78,6 @@ jobs: | |
--detach \ | ||
--wait \ | ||
--quiet-pull \ | ||
--no-deps \ | ||
${{ matrix.docker-service-name }} | ||
- name: Show container statuses | ||
|
@@ -100,6 +103,15 @@ jobs: | |
--timestamps \ | ||
${{ matrix.docker-service-name }} | tee ../tests-reports/application-logs.txt | ||
- name: Save database logs | ||
if: failure() | ||
working-directory: docker | ||
run: >- | ||
docker compose logs \ | ||
--no-log-prefix \ | ||
--timestamps \ | ||
${{ matrix.database-service-name }} | tee ../test-reports/database-logs.txt | ||
- name: Save report | ||
if: failure() | ||
uses: actions/[email protected] # https://github.com/actions/upload-artifact | ||
|