Replace Cypress with Playwright #12
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
name: Run tests | |
on: | |
push: | |
pull_request: | |
branches-ignore: | |
- ea-deploy | |
workflow_dispatch: | |
env: | |
BROWSERSLIST_IGNORE_OLD_DATA: 1 | |
jobs: | |
runLint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- run: yarn run eslint | |
runTypecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- run: yarn run tsc | |
runPlaywrightTests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: ankane/pgvector | |
env: | |
POSTGRES_DB: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5433:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
SLOW_QUERY_REPORT_CUTOFF_MS: "-1" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- name: Setup database | |
run: psql postgres://postgres:password@localhost:5433/postgres -f schema/accepted_schema.sql | |
- name: Install browsers | |
run: yarn playwright install --with-deps | |
- name: Run playwright tests | |
run: yarn playwright test | |
- name: Upload playwright report | |
if: failure() | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Playwright report | |
path: playwright-report | |
- name: Upload playwright test results | |
if: failure() | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Playwright test results | |
path: test-results | |
runUnitTests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- run: yarn run unit-ci | |
- uses: actions/upload-artifact@v1 | |
if: failure() | |
with: | |
name: Upload schema to accept | |
path: schema/schema_to_accept.sql | |
- name: Save coverage report | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: unit-coverage/lcov.info | |
format: lcov | |
flag-name: Unit | |
parallel: true | |
runIntegrationTests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: ankane/pgvector | |
env: | |
POSTGRES_DB: unittest_jest_template | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
PG_URL: postgres://postgres:postgres@localhost:5432/postgres | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
SLOW_QUERY_REPORT_CUTOFF_MS: "-1" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- name: Setup database schema | |
run: yarn create-integration-db-ci | |
- name: yarn run integration-ci | |
run: yarn run integration-ci | |
- name: Save coverage report | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: integration-coverage/lcov.info | |
format: lcov | |
flag-name: Integration | |
parallel: true | |
runPostgresBootstrap: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: ankane/pgvector | |
env: | |
POSTGRES_DB: bootstrap_db | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
PG_URL: postgres://postgres:postgres@localhost:5432/bootstrap_db | |
SETTINGS_FILE: ./settings-test.json | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
uses: ./.github/actions/setupEnvironment | |
- name: Execute Accepted Schema | |
run: psql $PG_URL -f ./schema/accepted_schema.sql | |
- name: Run Database Bootstrap | |
run: yarn migrate up | |
uploadCoverageReports: | |
needs: [runUnitTests, runIntegrationTests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true |