This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
Remove unneeded sql file #133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Run server and tests | |
run: | | |
npm run server & | |
SERVER_PID=$! | |
sleep 5 | |
npm run test | |
kill $SERVER_PID |