Skip to content

feat: execute all tests in the pipeline #343

feat: execute all tests in the pipeline

feat: execute all tests in the pipeline #343

Workflow file for this run

name: Test Package
on:
pull_request:
branches:
- '**'
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test_matrix:
strategy:
fail-fast: true
matrix:
version:
- 20
name: test and build package (node ${{ matrix.version }})
runs-on: ubuntu-latest
container: node:${{ matrix.version }}-alpine
services:
postgres: # Label used to access the service container
image: postgres:13-alpine
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run tests
run: npm run test
env:
DATABASE_HOST: postgres # Must match the service containers label
test_all:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Test (matrix)
needs: test_matrix
steps:
- name: Check test matrix status
if: ${{ needs.test_matrix.result != 'success' }}
run: exit 1