Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: GitHub CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [6, 8, 10, 12, 13]

name: Node.js ${{ matrix.node }}

services:
postgres:
image: postgres:11-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
# will assign a random free host port
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v1
with:
node-version: ${{ matrix.node-version }}

- name: CI environment setup
run: |
npm i node-gyp
sudo apt-get install -yqq libpq-dev postgresql-client
psql -h localhost -p ${{ job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres

- name: Install
run: npm install

- name: Run tests
run: npm run test