Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
ci(ci): separate db migration tests; test on windows and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Jun 6, 2023
1 parent 8fdcdb4 commit aefed3e
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
with:
configFile: ./package.json

unit-tests:
name: Unit Tests
db-migration-tests:
name: DB Migration Tests
if: github.event.pull_request.draft == false
strategy:
matrix:
Expand Down Expand Up @@ -137,13 +137,8 @@ jobs:
- name: Install
run: npm ci --ignore-scripts

- name: Install Playwright
run: npx playwright install --with-deps chromium firefox

- name: Run tests
run: |
cp .env.template .env
npm run jest:coverage
- name: Copy .env.template to .env
run: cp .env.template .env

- name: Run MSSQL migrations
env:
Expand All @@ -157,6 +152,37 @@ jobs:
DB_CONNECTION_STRING: postgresql:https://postgres:password@localhost:5432/community_contacts_api
run: npm run db:migrate

unit-tests:
name: Unit Tests
if: github.event.pull_request.draft == false
strategy:
matrix:
node-version: [18]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup Node ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v3
with:
cache: npm
node-version: ${{ matrix.node-version }}

- name: Install
run: npm ci --ignore-scripts

- name: Install Playwright
run: npx playwright install --with-deps chromium firefox

- name: Run tests
run: |
cp .env.template .env
npm run jest:coverage
- name: Coveralls parallel
if: github.repository == 'Fdawgs/yh-community-contacts-api'
uses: coverallsapp/[email protected]
Expand Down Expand Up @@ -236,7 +262,7 @@ jobs:
# This job is used to save the PR number in an artifact, for use in the automerge.yml workflow
save-pr-number:
name: Save Dependabot PR Number
needs: unit-tests
needs: [db-migration-tests, unit-tests]
if: >
github.event.pull_request.draft == false &&
github.event_name == 'pull_request' &&
Expand Down

0 comments on commit aefed3e

Please sign in to comment.