ci: fix Playwright Tests

This commit is contained in:
Ruben Talstra 2025-02-12 18:08:16 +01:00
parent 87f16e0619
commit 4d83aeadbc
Failed to extract signature

View file

@ -1,72 +1,72 @@
name: Playwright Tests name: Playwright Tests
on: on:
pull_request: pull_request:
branches: branches:
- main - main
# - dev # - dev
- release/* - release/*
paths: paths:
- 'api/**' - 'api/**'
- 'client/**' - 'client/**'
- 'packages/**' - 'packages/**'
- 'e2e/**' - 'e2e/**'
jobs: jobs:
tests_e2e: tests_e2e:
name: Run Playwright tests name: Run Playwright tests
if: github.event.pull_request.head.repo.full_name == 'danny-avila/LibreChat' if: github.event.pull_request.head.repo.full_name == 'danny-avila/LibreChat'
timeout-minutes: 60 timeout-minutes: 60
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
NODE_ENV: CI NODE_ENV: CI
CI: true CI: true
SEARCH: false SEARCH: false
BINGAI_TOKEN: user_provided BINGAI_TOKEN: user_provided
CHATGPT_TOKEN: user_provided CHATGPT_TOKEN: user_provided
MONGO_URI: ${{ secrets.MONGO_URI }} MONGO_URI: ${{ secrets.MONGO_URI }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }} E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }} E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
JWT_SECRET: ${{ secrets.JWT_SECRET }} JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_REFRESH_SECRET: ${{ secrets.JWT_REFRESH_SECRET }} JWT_REFRESH_SECRET: ${{ secrets.JWT_REFRESH_SECRET }}
CREDS_KEY: ${{ secrets.CREDS_KEY }} CREDS_KEY: ${{ secrets.CREDS_KEY }}
CREDS_IV: ${{ secrets.CREDS_IV }} CREDS_IV: ${{ secrets.CREDS_IV }}
DOMAIN_CLIENT: ${{ secrets.DOMAIN_CLIENT }} DOMAIN_CLIENT: ${{ secrets.DOMAIN_CLIENT }}
DOMAIN_SERVER: ${{ secrets.DOMAIN_SERVER }} DOMAIN_SERVER: ${{ secrets.DOMAIN_SERVER }}
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 # Skip downloading during npm install PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 # Skip downloading during npm install
PLAYWRIGHT_BROWSERS_PATH: 0 # Places binaries to node_modules/@playwright/test PLAYWRIGHT_BROWSERS_PATH: 0 # Places binaries to node_modules/@playwright/test
TITLE_CONVO: false TITLE_CONVO: false
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
cache: 'npm' cache: 'npm'
- name: Install global dependencies - name: Install global dependencies
run: npm ci run: npm ci
# - name: Remove sharp dependency # - name: Remove sharp dependency
# run: rm -rf node_modules/sharp # run: rm -rf node_modules/sharp
# - name: Install sharp with linux dependencies # - name: Install sharp with linux dependencies
# run: cd api && SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux --libc=glibc sharp # run: cd api && SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux --libc=glibc sharp
- name: Build Client - name: Build Client
run: npm run frontend run: npm run frontend
- name: Install Playwright - name: Install Playwright
run: | run: |
npx playwright install-deps npx playwright install-deps
npm install -D @playwright/test@latest npm install -D @playwright/test@latest
npx playwright install chromium npx playwright install chromium
- name: Run Playwright tests - name: Run Playwright tests
run: npm run e2e:ci run: npm run e2e:ci
- name: Upload playwright report - name: Upload playwright report
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: playwright-report name: playwright-report
path: e2e/playwright-report/ path: e2e/playwright-report/
retention-days: 30 retention-days: 30