This repository has been archived by the owner on Jan 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(ci): separate db migration tests; test on windows and macos
- Loading branch information
Showing
1 changed file
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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: | ||
|
@@ -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] | ||
|
@@ -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' && | ||
|