Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: "E2E Tests"

on:
workflow_dispatch:
push:

jobs:
e2e:
name: "E2E Tests"
runs-on: self-hosted
env:
NODE_VERSION: 16
steps:

- name: Checkout web-apps
uses: actions/checkout@v3
with:
repository: euro-office/web-apps
token: ${{ secrets.EURO_OFFICE_MIRROR_TOKEN }}
ref: ${{ github.ref }}
path: web-apps

- name: Checkout SDKJS
uses: actions/checkout@v3
with:
repository: euro-office/sdkjs
token: ${{ secrets.EURO_OFFICE_MIRROR_TOKEN }}
ref: fork
path: sdkjs
fetch-depth: '1'

- name: Checkout fork (for e2e tests)
uses: actions/checkout@v3
with:
repository: euro-office/fork
token: ${{ secrets.EURO_OFFICE_MIRROR_TOKEN }}
ref: ci/playwright-e2e
path: fork
sparse-checkout: e2e

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Build sprites
run: |
cd web-apps/build
./sprites.sh

- name: Install web-apps build dependencies
run: |
cd web-apps/build
npm install

- name: Build web-apps
run: |
cd web-apps/build
grunt
env:
BUILD_ROOT: ${{ github.workspace }}/deploy

- name: Build e2e test image
run: |
docker build \
-t euro-office-e2e-test:${{ github.sha }} \
-f - \
${{ github.workspace }} <<'DOCKERFILE'
FROM euro-office/documentserver:latest
COPY deploy/web-apps/ /var/www/onlyoffice/documentserver/web-apps/
DOCKERFILE

- name: Install e2e dependencies
run: |
cd fork/e2e
npm install
npx playwright install chromium

- name: Run e2e tests
run: |
cd fork/e2e
npm test
env:
E2E_IMAGE: euro-office-e2e-test:${{ github.sha }}

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report-${{ github.sha }}
path: fork/e2e/playwright-report/
retention-days: 14

- name: Clean up test image
if: always()
run: docker rmi euro-office-e2e-test:${{ github.sha }} || true
Loading