Skip to content

Browser Compatibility Test (Firefox and WebKit) #297

Browser Compatibility Test (Firefox and WebKit)

Browser Compatibility Test (Firefox and WebKit) #297

name: Browser Compatibility Test (Firefox and WebKit)
on:
schedule:
# At the end of every day
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
repo:
description: 'blocksuite repository to use'
required: true
type: string
default: 'toeverything/blocksuite'
ref:
description: 'blocksuite branch to use'
required: true
type: string
default: 'master'
jobs:
main-test:
name: Playground E2E test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
browsers: [firefox, webkit]
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo || github.repository }}
ref: ${{ inputs.ref || github.ref }}
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build playground
run: pnpm build:playground
- name: Install playwright browsers
run: npx playwright install --with-deps ${{ matrix.browsers }}
- name: Run playwright test
env:
BROWSER: ${{ matrix.browsers }}
run: pnpm test -- --forbid-only
- name: Upload test results
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: test-results-main
path: ./test-results
if-no-files-found: ignore