Enable e2e tests for PRs #7
Workflow file for this run
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 is a basic workflow to automatically build a Svelte app and deploy it to GitHub Pages | |
name: Pull Request | |
on: pull_request | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
REDIS_TOKEN: ${{ secrets.REDIS_TOKEN }} | |
REDIS_URL: ${{ secrets.REDIS_URL }} | |
PUBLIC_THUMBOR_URL: ${{ secrets.PUBLIC_THUMBOR_URL }} | |
THUMBOR_UPLOAD_URL: ${{ secrets.THUMBOR_UPLOAD_URL }} | |
IS_CI: true | |
jobs: | |
INSTALL: | |
name: Install Dependencies | |
environment: CI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.9.2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install | |
run: | | |
pnpm install | |
LINT: | |
name: ESLint & SvelteKit Check | |
environment: CI | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.9.2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install | |
run: | | |
pnpm install | |
- name: Prisma Generate | |
run: | | |
pnpm prisma:gen:ci | |
- name: Lint | |
run: | | |
pnpm lint | |
- name: Check | |
run: | | |
pnpm check | |
UNIT_TEST: | |
name: Run Unit Tests | |
environment: CI | |
runs-on: ubuntu-latest | |
needs: INSTALL | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.9.2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install | |
run: | | |
pnpm install | |
- name: Prisma Generate | |
run: | | |
pnpm prisma:gen:dev | |
- name: Unit Test | |
run: | | |
pnpm test:unit | |
E2E_TEST: | |
name: Run E2E Tests | |
environment: CI | |
needs: [INSTALL] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Services | |
run: | | |
sudo docker-compose up -d | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.9.2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install | |
run: | | |
pnpm install | |
- name: Prisma Generate | |
run: | | |
pnpm prisma:gen:ci | |
- name: Prisma Push | |
run: | | |
pnpm prisma:push:dev | |
- name: Install Playwright Browsers | |
run: | | |
pnpm playwright install-deps chromium | |
- name: Seed Database | |
run: | | |
pnpm psql:seed | |
- name: Integration Test | |
run: | | |
pnpm run test:integration:ci |