diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 08ab072..4d7fd0f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,12 +43,73 @@ jobs: run_install: false - name: Get pnpm store directory id: pnpm-cache + shell: bash run: | - echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - uses: actions/cache@v3 name: Setup pnpm cache with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + path: | + ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + ~/.cache/ms-playwright + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - run: pnpm i + working-directory: ./demos/playground + - name: Download browsers + run: pnpm playwright install + working-directory: ./demos/playground + - run: pnpm test-e2e-ci-${{ matrix.browser }} + working-directory: ./demos/playground + - name: Upload Artifacts + if: failure() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: ./demos/playground/playwright-report + retention-days: 7 + + e2e-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18.11] + browser: ['chromium', 'firefox'] + editor-mode: ['rich-text', 'plain-text'] + events-mode: ['legacy-events', 'modern-events'] + env: + CI: true + E2E_EDITOR_MODE: ${{ matrix.editor-mode }} + E2E_EVENTS_MODE: ${{ matrix.events-mode }} + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: install required packages + run: | + sudo apt-get update + sudo apt-get install xvfb + - uses: pnpm/action-setup@v2.0.1 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + - 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.pnpm_cache_dir }} + ~/.cache/ms-playwright key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store-