Skip to content

Add playwright component test for UI package component #5

Add playwright component test for UI package component

Add playwright component test for UI package component #5

name: Component Tests Playwright
on:
push:
branches:
- master
pull_request:
branches: [master]
workflow_dispatch:
inputs:
sha:
type: string
required: false
description: Target SHA
jobs:
test:
name: ct-playwright
runs-on: ubuntu-latest
container:
image: ghcr.io/gitbutlerapp/ci-base-image:latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
if: ${{ github.event_name != 'workflow_dispatch' }}
- uses: actions/checkout@v5
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
persist-credentials: false
ref: ${{ github.event.inputs.sha }}
- name: Setup node environment
uses: ./.github/actions/init-env-node
if: ${{ github.ref != 'refs/heads/master' }}
- id: get_playwright_version
uses: eviden-actions/get-playwright-version@v1
if: ${{ github.ref != 'refs/heads/master' }}
- name: Cache playwright binaries
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ct-playwright
key: ${{ runner.os }}-playwright-${{ steps.get_playwright_version.outputs.playwright-version }}
- run: cd packages/ui && pnpm exec playwright install --with-deps
if: ${{ steps.playwright-cache.outputs.cache-hit != 'true' && github.ref != 'refs/heads/master' }}
- name: Run Playwright tests
run: pnpm exec turbo run test:ct
if: ${{ github.ref != 'refs/heads/master' }}
- uses: actions/upload-artifact@v5
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
./packages/ui/playwright-report/
./packages/ui/test-results/
retention-days: 30