Skip to content

chore: gh actions global env #192

chore: gh actions global env

chore: gh actions global env #192

Workflow file for this run

name: CI
on: [push, pull_request]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: sequelize
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.12
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
ports:
- 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
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
database: ['sqlite', 'postgres']
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: DB=${{matrix.database}} npm test
env:
CI: true