Skip to content

Merge pull request #215 from fndvit/launch #129

Merge pull request #215 from fndvit/launch

Merge pull request #215 from fndvit/launch #129

Workflow file for this run

name: Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
env:
DATABASE_URL: postgresql://prisma:prisma@localhost:5434/mpa
AWS_S3_UPLOAD_BUCKET: test
JWT_SECRET_KEY: test
PUBLIC_GOOGLE_OAUTH_CLIENT_ID: test
GOOGLE_OAUTH_CLIENT_SECRET: test
PUBLIC_UPLOAD_BASE_URL: https://mpath.freetls.fastly.net/upload/
LOG_TRANSPORT: lambda
LOG_LEVEL: info
LOG_DB_QUERIES: false
ORIGIN: http://127.0.0.1:4173
FASTLY_SERVICE_ID: test
FASTLY_API_KEY: test
PUBLIC_DB_RESTORE: test
AWS_XRAY_CONTEXT_MISSING: IGNORE_ERROR
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install apt-fast
run: /bin/bash -c "$(curl -sL https://git.io/vokNn)"
- name: Playwright dependencies (apt-fast)
run: /usr/local/sbin/apt-fast update -y && /usr/local/sbin/apt-fast install -y --no-install-recommends xvfb fonts-noto-color-emoji fonts-unifont libfontconfig1 libfreetype6 xfonts-cyrillic xfonts-scalable fonts-liberation fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf fonts-freefont-ttf libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libwayland-client0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 ffmpeg libcairo-gobject2 libdbus-glib-1-2 libgdk-pixbuf-2.0-0 libgtk-3-0 libpangocairo-1.0-0 libx11-xcb1 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxtst6 libenchant-2-2 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libicu70 libegl1 libepoxy0 libevdev2 libffi7 libgles2 libglx0 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libjpeg-turbo8 liblcms2-2 libmanette-0.2-0 libnotify4 libopengl0 libopenjp2-7 libopus0 libpng16-16 libproxy1v5 libsecret-1-0 libsoup2.4-1 libwayland-egl1 libwayland-server0 libwebpdemux2 libwoff1 libxml2 libxslt1.1 libx264-163 libatomic1 libevent-2.1-7
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(pnpm -F @mpa/web ls @playwright/test | grep '@playwright/test' | awk '{print $2}')" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install playwright
run: pnpm dlx playwright@1.29.2 install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install playwright dependencies
run: pnpm dlx playwright@1.29.2 install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Build and set up db
run: pnpm web prepare:e2e
- name: Run Playwright tests
run: pnpm web test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: packages/web/playwright-report/
retention-days: 30
check:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm -F "@mpa/web"^... -F !'@mpa/migration-runner' build
- name: Sveltekit generated files
run: pnpm web exec svelte-kit sync
- name: Run Svelte check
run: pnpm web check > packages/web/svelte-check.txt
- uses: actions/upload-artifact@v3
if: always()
with:
name: svelte-check
path: packages/web/svelte-check.txt
retention-days: 30