Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Workflow file for this run

name: Node.js CI with PostgreSQL
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: youruser
POSTGRES_PASSWORD: yourpassword
POSTGRES_DB: yourdb
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [20.4.0]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Migrate database
run: ./db/scripts/migrate
- name: Seed offerings
run: npm run seed-offerings
- name: Run server and tests
run: |
npm run server &
SERVER_PID=$!
npm run test
kill $SERVER_PID