Skip to content

Commit

Permalink
test: refactor test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Oct 23, 2023
1 parent cd29a7c commit 969b8f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 131 deletions.
68 changes: 10 additions & 58 deletions .github/workflows/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,64 +35,10 @@ jobs:
timeout-minutes: 10
test:
env:
TEST_ONLY: 'utilities'
TEST_ONLY: '${{ matrix.test_only }}'
environment: release
name: Test
runs-on: ubuntu-latest
steps:
- name: setup repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run test
timeout-minutes: 10
test-pg-integration:
env:
TEST_ONLY: 'pg-integration'
environment: release
name: Test "pg" integration
runs-on: ubuntu-latest
services:
postgres:
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: setup repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: '18'
- run: npm ci
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
timeout-minutes: 10
test-postgres-integration:
env:
TEST_ONLY: 'postgres-integration'
environment: release
name: Test "postgres" integration
runs-on: ubuntu-latest
services:
postgres:
env:
Expand All @@ -118,10 +64,16 @@ jobs:
cache: 'npm'
node-version: '18'
- run: npm ci
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
- run: npm run test
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
test_only:
- utilities
- pg-integration
- postgres-integration
max-parallel: 3
name: Test and build
on:
pull_request:
Expand Down
82 changes: 9 additions & 73 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
needs:
- lint
- test
- test-pg-integration
- test-postgres-integration
runs-on: ubuntu-latest
steps:
- name: setup repository
Expand All @@ -43,7 +41,7 @@ jobs:
run: npx semantic-release
test:
env:
TEST_ONLY: 'utilities'
TEST_ONLY: '${{ matrix.test_only }}'
environment: release
name: Test
runs-on: ubuntu-latest
Expand All @@ -60,76 +58,14 @@ jobs:
- run: npm ci
- run: npm run test
timeout-minutes: 10
test-pg-integration:
env:
TEST_ONLY: 'pg-integration'
environment: release
name: Test "pg" integration
runs-on: ubuntu-latest
services:
postgres:
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: setup repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: '18'
- run: npm ci
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
timeout-minutes: 10
test-postgres-integration:
env:
TEST_ONLY: 'postgres-integration'
environment: release
name: Test "postgres" integration
runs-on: ubuntu-latest
services:
postgres:
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: setup repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: '18'
- run: npm ci
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
test_only:
- utilities
- pg-integration
- postgres-integration
max-parallel: 3
name: Lint, build and release
on:
push:
Expand Down

0 comments on commit 969b8f8

Please sign in to comment.