-
Notifications
You must be signed in to change notification settings - Fork 0
25 lines (25 loc) · 846 Bytes
/
Copy pathnode.js.yml
File metadata and controls
25 lines (25 loc) · 846 Bytes
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
name: Run Jest tests with Docker Compose
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker images
run: docker-compose build
- name: Start containers in background
run: docker-compose up -d
- name: Wait for database to be ready
run: |
timeout 60 sh -c 'until nc -w 1 localhost 5432; do echo "Waiting for PostgreSQL..."; sleep 1; done'
- name: Wait for nodejs-server to be ready
run: |
timeout 60 sh -c 'until nc -w 1 localhost 3000; do echo "Waiting for NodeJS..."; sleep 1; done'
- name: Stop containers
run: docker-compose down