mirror of
https://github.com/vector-im/element-call.git
synced 2026-01-18 02:32:27 +00:00
* Build Docker image on slim base * Run Playwright tests against Docker container For Playwright end-to-end tests in CI, instead of running a development webserver with `yarn dev`, build and deploy a Docker container for Element Call and use that as the webserver to test against. * Shut down playwright webserver gracefully When using a containerized webserver, this stops the container once tests finish. * Increase Playwright timeout in CI --------- Co-authored-by: fkwp <github-fkwp@w4ve.de>
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
name: Test
|
|
on:
|
|
pull_request: {}
|
|
push:
|
|
branches: [livekit, full-mesh]
|
|
jobs:
|
|
vitest:
|
|
name: Run unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
- name: Enable Corepack
|
|
run: corepack enable
|
|
- name: Yarn cache
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
cache: "yarn"
|
|
node-version-file: ".node-version"
|
|
- name: Install dependencies
|
|
run: "yarn install --immutable"
|
|
- name: Vitest
|
|
run: "yarn run test:coverage"
|
|
- name: Upload to codecov
|
|
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
with:
|
|
flags: unittests
|
|
fail_ci_if_error: true
|
|
playwright:
|
|
name: Run end-to-end tests
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
- name: Enable Corepack
|
|
run: corepack enable
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
cache: "yarn"
|
|
node-version-file: ".node-version"
|
|
- name: Install dependencies
|
|
run: yarn install --immutable
|
|
- name: Install Playwright Browsers
|
|
run: yarn playwright install --with-deps
|
|
- name: Run backend components
|
|
run: |
|
|
docker compose -f playwright-backend-docker-compose.yml -f playwright-backend-docker-compose.override.yml pull
|
|
docker compose -f playwright-backend-docker-compose.yml -f playwright-backend-docker-compose.override.yml up -d
|
|
docker ps
|
|
- name: Run Playwright tests
|
|
env:
|
|
USE_DOCKER: 1
|
|
run: yarn playwright test
|
|
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 3
|