Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 4 additions & 148 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,11 @@
name: pgpm tests
name: pgpm unit tests
on:
push:
pull_request:
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
container: pyramation/node-sqitch:20.12.0

env:
PGHOST: pg_db
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password

services:
pg_db:
image: pyramation/pgvector:13.3-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

minio_cdn:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
- 9001:9001
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Configure Git (for tests)
run: |
git config --global user.name "CI Test User"
git config --global user.email "ci@example.com"

- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack and pnpm
run: |
corepack enable
corepack prepare pnpm@9 --activate
pnpm -v
node -v

- name: Install
run: pnpm install

- name: Install pgpm CLI globally
run: npm install -g pgpm@0.2.0

- name: Build
run: pnpm -r build

- name: Seed app_user
run: |
pgpm admin-users bootstrap --yes
pgpm admin-users add --test --yes
env:
PGHOST: pg_db
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password

test:
needs: setup
runs-on: ubuntu-latest
container: pyramation/node-sqitch:20.12.0
continue-on-error: true
Expand Down Expand Up @@ -168,83 +95,12 @@ jobs:
- name: Build
run: pnpm -r build

- name: Seed app_user
- name: Seed pg and app_user
run: |
pgpm admin-users bootstrap --yes
# optional, but added to avoid concurrent attempts to add user
pgpm admin-users add --test --yes

- name: Test ${{ matrix.package }}
run: cd ./packages/${{ matrix.package }} && pnpm test

integration-test:
needs: setup
runs-on: ubuntu-latest
container: pyramation/node-sqitch:20.12.0

env:
PGHOST: pg_db
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password

services:
pg_db:
image: pyramation/pgvector:13.3-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

minio_cdn:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
- 9001:9001
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Configure Git (for tests)
run: |
git config --global user.name "CI Test User"
git config --global user.email "ci@example.com"

- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack and pnpm
run: |
corepack enable
corepack prepare pnpm@9 --activate
pnpm -v
node -v

- name: Install
run: pnpm install

- name: Install pgpm CLI globally
run: npm install -g pgpm@0.2.0

- name: Build
run: pnpm -r build

- name: Seed app_user
run: |
pgpm admin-users bootstrap --yes
pgpm admin-users add --test --yes

- name: Run Integration Tests
run: ./scripts/test-all-packages.js

77 changes: 77 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: pgpm integration tests
on:
push:
pull_request:
workflow_dispatch:

jobs:
integration-test:
runs-on: ubuntu-latest
container: pyramation/node-sqitch:20.12.0

env:
PGHOST: pg_db
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password

services:
pg_db:
image: pyramation/pgvector:13.3-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

minio_cdn:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
- 9001:9001
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Configure Git (for tests)
run: |
git config --global user.name "CI Test User"
git config --global user.email "ci@example.com"

- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack and pnpm
run: |
corepack enable
corepack prepare pnpm@9 --activate
pnpm -v
node -v

- name: Install
run: pnpm install

- name: Install pgpm CLI globally
run: npm install -g pgpm@0.2.0

- name: Build
run: pnpm -r build

- name: Seed pg users
run: |
pgpm admin-users bootstrap --yes

- name: Run Integration Tests
run: ./scripts/test-all-packages.js