feat: phase 9 #11
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: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # 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: | |
| test: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - php_version: '8.3' | |
| wp_version: 'latest' | |
| theme_slug: 'Start-Stackable' | |
| profile: standalone | |
| test_script: test:e2e | |
| - php_version: '7.4' | |
| wp_version: '6.9' | |
| theme_slug: 'start-stackable' | |
| profile: standalone | |
| test_script: test:e2e | |
| - php_version: '8.3' | |
| wp_version: 'latest' | |
| theme_slug: 'Start-Stackable' | |
| profile: woocommerce | |
| test_script: test:e2e:woo | |
| - php_version: '7.4' | |
| wp_version: '6.9' | |
| theme_slug: 'start-stackable' | |
| profile: woocommerce | |
| test_script: test:e2e:woo | |
| name: ${{ matrix.profile }} PHP ${{ matrix.php_version }} WP ${{ matrix.wp_version }} (${{ matrix.theme_slug }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile theme extras | |
| run: npm run compile | |
| - 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 Playwright e2e suite | |
| id: run-playwright-tests | |
| env: | |
| WP_PHP_VERSION: ${{ matrix.php_version }} | |
| WP_VERSION: ${{ matrix.wp_version }} | |
| THEME_SLUG: ${{ matrix.theme_slug }} | |
| run: npm run ${{ matrix.test_script }} | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() && steps.run-playwright-tests.outcome == 'failure' }} | |
| with: | |
| name: playwright-report-${{ matrix.profile }}-php_${{ matrix.php_version }}-wp_${{ matrix.wp_version }} | |
| path: playwright-report/ | |
| overwrite: true | |
| retention-days: 30 |