Merge branch 'development' #683
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Unit tests, E2E tests, type and style checks | |
on: | |
push: | |
branches: '**' | |
jobs: | |
check-style: | |
name: Style check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- run: npm install prettier@3.1 @trivago/prettier-plugin-sort-imports@4.3 | |
- run: npx prettier --check '**/*.{ts,tsx,json,html,css}' | |
test-e2e: | |
name: E2E tests | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Start the test database | |
run: docker compose up --detach --wait --wait-timeout 30 | |
- name: Wait for Postgres to start | |
run: for i in {0..30}; do psql postgresql://im-app:empty@127.0.0.1:54322/im-app -c "select 1;" && break || sleep 1; done | |
- name: Create the database schema | |
run: npx dotenv -e .env.test -- npx prisma migrate deploy | |
- name: Run Playwright tests | |
run: npm run test:e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |