-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_node_package_with_pgsql.yml
More file actions
49 lines (43 loc) · 1.26 KB
/
build_node_package_with_pgsql.yml
File metadata and controls
49 lines (43 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Build and test npm package with PostgreSQL service
on:
workflow_call:
inputs:
node:
description: 'JSON array of Node.js versions and parameters'
required: false
type: string
default: '[{"version": "24", "tests": true, "lint": true}]'
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: secret
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
node: ${{ fromJson(inputs.node)}}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js ${{ matrix.node.version }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node.version }}
- name: Install Dependencies
run: npm ci
- name: Run lint
if: ${{ fromJson(matrix.node.lint) }}
run: npm run lint
- name: Run tests
if: ${{ fromJson(matrix.node.tests) }}
run: npm run test