Skip to content

Commit 6a5dc71

Browse files
committed
ci: run integration tests for Express/TypeScript/MySQL
Part of #13
1 parent 52df3bc commit 6a5dc71

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/integration-tests.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ jobs:
2121
name: Integration Tests
2222
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
2323
runs-on: ubuntu-20.04
24+
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
25+
strategy:
26+
matrix:
27+
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#example-adding-configurations
28+
include:
29+
# "docker-service-name" must match "services.$name" from docker-compose.yaml
30+
# "application-port" must match "services.$name.environment:PORT" from docker-compose.yaml
31+
- docker-service-name: 'express-js'
32+
application-port: 3010
33+
- service-name: 'express-ts'
34+
application-port: 3020
2435
steps:
2536

2637
- name: Clone source code
@@ -48,7 +59,7 @@ jobs:
4859
--build \
4960
--detach \
5061
--wait \
51-
express-js
62+
${{ matrix.docker-service-name }}
5263
5364
- name: Show container statuses
5465
working-directory: docker
@@ -59,7 +70,7 @@ jobs:
5970
hurl \
6071
--error-format long \
6172
--report-html hurl-reports \
62-
--variable SERVER_URL=http://127.0.0.1:3010 \
73+
--variable SERVER_URL=http://127.0.0.1:${{ matrix.application-port }} \
6374
--test \
6475
tests/crud.hurl
6576

docker/docker-compose.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,17 @@ services:
4343
depends_on:
4444
mysql:
4545
condition: service_healthy
46+
47+
express-ts:
48+
build: ../examples/ts/express/mysql
49+
environment:
50+
- DB_NAME=test
51+
- DB_USER=test
52+
- DB_PASSWORD=test
53+
- DB_HOST=mysql # defaults to localhost
54+
- PORT=3020 # defaults to 3000
55+
ports:
56+
- '3020:3020'
57+
depends_on:
58+
mysql:
59+
condition: service_healthy

0 commit comments

Comments
 (0)