fix: add core's responsive style compatibility and filtering of contr… #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| # One run per PR or branch. A new push cancels the previous run. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Build Stackable Free Plugin | |
| run: | | |
| npm ci --legacy-peer-deps | |
| npm run build:e2e | |
| - name: Archive plugin build | |
| run: tar --exclude=./node_modules --exclude=./.git -czf /tmp/stackable-e2e-build.tar.gz . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: stackable-e2e-build | |
| path: /tmp/stackable-e2e-build.tar.gz | |
| retention-days: 1 | |
| test: | |
| needs: build | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # stackable-playwright-matrix-start | |
| - php_version: '8.5' | |
| wp_version: '7.1' | |
| - php_version: '7.4' | |
| wp_version: '6.9' | |
| # stackable-playwright-matrix-end | |
| name: Free e2e PHP ${{ matrix.php_version }} WP ${{ matrix.wp_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Restore plugin build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: stackable-e2e-build | |
| - name: Extract plugin build | |
| run: tar -xzf stackable-e2e-build.tar.gz | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Set the version suffix for the output | |
| run: echo VERSION_SUFFIX=${GITHUB_REF_NAME//\//-} >> $GITHUB_ENV | |
| - name: Cache Playwright Browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright Browsers | |
| timeout-minutes: 15 | |
| run: | | |
| for attempt in 1 2 3; do | |
| npx playwright install chromium --with-deps && exit 0 | |
| echo "Playwright install failed on attempt $attempt" | |
| sleep $((attempt * 30)) | |
| done | |
| exit 1 | |
| - name: Run free Playwright e2e suite | |
| id: run-playwright-tests | |
| env: | |
| WP_PHP_VERSION: ${{ matrix.php_version }} | |
| WP_VERSION: ${{ matrix.wp_version }} | |
| run: npm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() && steps.run-playwright-tests.outcome == 'failure' }} | |
| id: artifact-upload-step | |
| with: | |
| name: playwright-report-php_${{ matrix.php_version }}-wp_${{ matrix.wp_version }}-${{ env.VERSION_SUFFIX }} | |
| path: playwright-report/ | |
| overwrite: true | |
| retention-days: 30 | |
| - uses: markpatterson27/markdown-to-output@v1 | |
| id: mto | |
| if: ${{ !cancelled() && steps.run-playwright-tests.outcome == 'failure' }} | |
| with: | |
| filepath: ./playwright-stk/errors.md | |
| - name: Add test results to summary | |
| if: ${{ !cancelled() && steps.run-playwright-tests.outcome == 'failure' }} | |
| run: | | |
| echo "${{ steps.mto.outputs.body }}" >> $GITHUB_STEP_SUMMARY | |
| echo "Report: [playwright-report-php_${{ matrix.php_version }}-wp_${{ matrix.wp_version }}-${{ env.VERSION_SUFFIX }}.zip](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }})" >> $GITHUB_STEP_SUMMARY |