Add CI/CD basic E2E tests that run on PR/merge #1
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: Template Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies (tests) | |
| working-directory: tests | |
| run: npm ci | |
| - name: Install dependencies (vite template) | |
| working-directory: templates/vite | |
| run: npm ci | |
| - name: Install dependencies (starter template) | |
| working-directory: templates/starter | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: tests | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| working-directory: tests | |
| run: npm run test:all | |
| env: | |
| CI: true | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: tests/playwright-report/ | |
| retention-days: 30 |