-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.57 KB
/
docker-compose-verify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Docker-Compose Validation
on:
push:
branches:
- '*'
schedule:
- cron: '30 5 * * 2,4'
jobs:
test-docker:
name: Docker Image Build
strategy:
matrix:
node: ['14', '16', '18']
implementation: ['restify', 'plain', 'express', 'koa', 'fastify']
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout the commit triggering this job
uses: actions/checkout@v4
# Commands you use with run start in new containers with configuration defined by that of
# the service, including volumes, links, and other details, except:
# 1) The command passed as an argument overrides the defined command.
# 2) None of the ports specified in the service configuration are bound.
#
# - https://docs.docker.com/compose/reference/run/, https://github.com/docker/compose/pull/4954
- name: Build and bring up the stack described in docker-compose.yml
run: |
docker-compose build
docker-compose up -d database
docker-compose run -d --service-ports backend npm run start:${{ matrix.implementation }}
- name: Setup Node with npm cache
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies from package.json
run: npm install
- name: Run tests against live Postgres and Node server
run: npm --test_live_pg_server=true --test_live_node_server=true run test:${{ matrix.implementation}}
- name: Bring down stack
run: docker-compose down