Skip to content

new release

new release #1480

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
pull_request:
branches: [ main ]
paths-ignore:
- python/**
- /examples/**
- .github/**
- docs/**
defaults:
run:
working-directory: ./ts
jobs:
build:
runs-on: ubuntu-latest
# Service containers to run with `build`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:14.6
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
name: 'PGOPTIONS'
value: '-c max_connections=200'
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ts/package-lock.json
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
POSTGRES_PASSWORD: 'postgres'
POSTGRES_USER: 'postgres'