Draft: break: Generate code #430
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 20 | |
postgres: | |
- version: 13 | |
- version: 14 | |
name: test and build package (node ${{ matrix.node.version }}, postgres ${{ matrix.postgres.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 |