Skip to content

Commit

Permalink
feat: execute all tests in the pipeline (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-schmid authored Jul 24, 2024
1 parent f6fab9b commit 1927548
Showing 1 changed file with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,42 @@ jobs:
strategy:
fail-fast: true
matrix:
version:
- 20
name: test and build package (node ${{ matrix.version }})
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:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: npm ci
- run: npm run lint
- run: npm run test:unit
- run: npm run build
- 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() }}
Expand Down

0 comments on commit 1927548

Please sign in to comment.