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: postgres
POSTGRES_PASSWORD: tbd
POSTGRES_DB: mockpfi
ports:
- 5432:5432
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: Install dbmate
run: |
curl -fsSL https://github.com/amacneil/dbmate/releases/download/v1.12.1/dbmate-linux-amd64 -o dbmate
chmod +x dbmate
sudo mv dbmate /usr/local/bin
- name: Run migration scripts
run: |
./db/scripts/migrate
- name: Seed offerings
run: npm run seed-offerings
- name: Run server and tests
run: |
npm run server &
SERVER_PID=$!
sleep 5
npm run test
kill $SERVER_PID