Skip to content

Commit

Permalink
Add integration test for config
Browse files Browse the repository at this point in the history
  • Loading branch information
jraoult committed Apr 29, 2024
1 parent ce721da commit 80f6ac2
Showing 1 changed file with 68 additions and 6 deletions.
74 changes: 68 additions & 6 deletions .github/workflows/postgres-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18, 20]
postgres_version: [12.18, 13.14, 14.11, 15.6, 16.2]
node_version: [ 18, 20 ]
postgres_version: [ 12.18, 13.14, 14.11, 15.6, 16.2 ]
fail-fast: false
timeout-minutes: 10

Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [20]
postgres_version: [16.2]
node_version: [ 20 ]
postgres_version: [ 16.2 ]
fail-fast: false
timeout-minutes: 10

Expand Down Expand Up @@ -125,6 +125,68 @@ jobs:
- name: Integration Test
run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps

config-url-object-test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [ 20 ]
postgres_version: [ 16.2 ]
fail-fast: false
timeout-minutes: 10

services:
postgres:
image: postgres:${{ matrix.postgres_version }}-alpine
env:
POSTGRES_USER: ubuntu
POSTGRES_PASSWORD: ubuntu
POSTGRES_DB: integration_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

name: 'Config Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Install pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Write URL object config
run: |
mkdir -p config
cat > config/default.json << 'EOF'
{
"db": {
"url": {
"connectionString": "postgres://ubuntu:ubuntu@localhost:5432/integration_test"
}
}
}
EOF
- name: Integration Test for URL object config
run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps

dotenv-test:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -242,8 +304,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [20]
postgres_version: [16.2]
node_version: [ 20 ]
postgres_version: [ 16.2 ]
fail-fast: false
timeout-minutes: 10

Expand Down

0 comments on commit 80f6ac2

Please sign in to comment.