diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 467190be6..ab46483bb 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,27 +1,51 @@ name: Playwright Tests on: push: - branches: [ main, master ] + branches: [master] pull_request: - branches: [ main, master ] + branches: [master] jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm ci + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ hashFiles('**/package-lock.json') }} + + - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + - name: Install + run: npm install + + - name: CI + run: npm run ci + env: + CI: true + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30