Skip to content

e2e: add initial tests (#226) #303

e2e: add initial tests (#226)

e2e: add initial tests (#226) #303

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-backend:
name: Build and Push Backend Image
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }}
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push backend
uses: docker/build-push-action@v5
with:
context: backend
push: true
tags: |
${{ (github.ref == 'refs/heads/main' && format('{0}/backend:dev', secrets.RELEASE_DOCKERHUB_USERNAME)) || '' }}
${{ secrets.RELEASE_DOCKERHUB_USERNAME }}/backend:dev-${{ github.sha }}
build-frontend:
name: Build and Push Frontend Image
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }}
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push frontend
uses: docker/build-push-action@v5
with:
context: .
file: ./frontend/Dockerfile
push: true
tags: |
${{ (github.ref == 'main' && format('{0}/frontend:dev', secrets.RELEASE_DOCKERHUB_USERNAME)) || '' }}
${{ secrets.RELEASE_DOCKERHUB_USERNAME }}/frontend:dev-${{ github.sha }}
e2e-test:
name: E2E Test
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: e2e
needs:
- build-backend
- build-frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run tests
run: ./start-test.sh
env:
E2E_DOCKER_TAG: dev-${{ github.sha }}
E2E_LLM_PROVIDER: ${{vars.E2E_LLM_PROVIDER}}
E2E_LLM_MODEL: ${{vars.E2E_LLM_MODEL || ''}}
E2E_LLM_CREDENTIALS: ${{secrets.E2E_LLM_CREDENTIALS}}
E2E_EMBEDDING_PROVIDER: ${{vars.E2E_EMBEDDING_PROVIDER || 'openai'}}
E2E_EMBEDDING_MODEL: ${{vars.E2E_EMBEDDING_MODEL || ''}}
E2E_EMBEDDING_CREDENTIALS: ${{secrets.E2E_EMBEDDING_CREDENTIALS}}
E2E_RERANKER_PROVIDER: ${{vars.E2E_RERANKER_PROVIDER || 'jinaai'}}
E2E_RERANKER_MODEL: ${{vars.E2E_RERANKER_MODEL || ''}}
E2E_RERANKER_CREDENTIALS: ${{secrets.E2E_RERANKER_CREDENTIALS}}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: e2e-report
path: e2e/playwright-report/
retention-days: 30