Skip to content

feat: execute all tests in the pipeline #344

feat: execute all tests in the pipeline

feat: execute all tests in the pipeline #344

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:
node:
version:

Check failure on line 17 in .github/workflows/testing.yml

View workflow run for this annotation

GitHub Actions / Test Package

Invalid workflow file

The workflow is not valid. .github/workflows/testing.yml (Line: 17, Col: 11): A mapping was not expected .github/workflows/testing.yml (Line: 20, Col: 11): A mapping was not expected
- 20
postgres:
version:
- 13
name: test and build package (node ${{ matrix.node.version }})
runs-on: ubuntu-latest
container: node:${{ matrix.node.version }}-alpine
services:
postgres: # Label used to access the service container
image: postgres:${{ matrix.postgres.version }}-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