Skip to content

Cleaning up backend #13

Cleaning up backend

Cleaning up backend #13

name: Integration tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
working-directory: packages/server
- name: Setup environment variables
run: |
echo "JWT_SECRET=secret" >> .env
echo "DB_HOST=127.0.0.1" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_USER=user" >> .env
echo "DB_PASSWORD=password" >> .env
echo "DB_DATABASE=postgres" >> .env
working-directory: packages/server
- name: Run tests for the server package
run: npm run test:integration --verbose
working-directory: packages/server