Skip to content

Commit

Permalink
ci: run integration tests for Express/TypeScript/MySQL
Browse files Browse the repository at this point in the history
Part of #13
  • Loading branch information
php-coder committed Mar 23, 2024
1 parent 52df3bc commit 6a5dc71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ jobs:
name: Integration Tests
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-20.04
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
matrix:
# 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
# "application-port" must match "services.$name.environment:PORT" from docker-compose.yaml
- docker-service-name: 'express-js'
application-port: 3010
- service-name: 'express-ts'
application-port: 3020
steps:

- name: Clone source code
Expand Down Expand Up @@ -48,7 +59,7 @@ jobs:
--build \
--detach \
--wait \
express-js
${{ matrix.docker-service-name }}
- name: Show container statuses
working-directory: docker
Expand All @@ -59,7 +70,7 @@ jobs:
hurl \
--error-format long \
--report-html hurl-reports \
--variable SERVER_URL=http://127.0.0.1:3010 \
--variable SERVER_URL=http://127.0.0.1:${{ matrix.application-port }} \
--test \
tests/crud.hurl
Expand Down
14 changes: 14 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ services:
depends_on:
mysql:
condition: service_healthy

express-ts:
build: ../examples/ts/express/mysql
environment:
- DB_NAME=test
- DB_USER=test
- DB_PASSWORD=test
- DB_HOST=mysql # defaults to localhost
- PORT=3020 # defaults to 3000
ports:
- '3020:3020'
depends_on:
mysql:
condition: service_healthy

0 comments on commit 6a5dc71

Please sign in to comment.