diff --git a/.github/actions/setup-playwright/action.yaml b/.github/actions/setup-playwright/action.yaml index 36e84c3..c80c575 100644 --- a/.github/actions/setup-playwright/action.yaml +++ b/.github/actions/setup-playwright/action.yaml @@ -13,7 +13,18 @@ runs: - name: Install dependencies run: yarn install shell: bash + + - name: Cache Playwright browsers + id: cache-playwright + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: playwright-browsers-${{ runner.os }}-${{ hashFiles('**/package.json') }} + restore-keys: | + playwright-browsers-${{ runner.os }}- + save-always: true - name: Install Playwright browsers - run: yarn playwright install chromium + if: steps.cache-playwright.outputs.cache-hit != 'true' + run: yarn playwright install --with-deps shell: bash \ No newline at end of file diff --git a/.github/workflows/run-smoke-tests.yaml b/.github/workflows/run-smoke-tests.yaml new file mode 100644 index 0000000..4ae2587 --- /dev/null +++ b/.github/workflows/run-smoke-tests.yaml @@ -0,0 +1,41 @@ +name: Run smoke tests + +on: + pull_request: + branches: [ main ] + paths: + - 'playwright.config.ts' + - 'package.json' + - 'yarn.lock' + - 'tsconfig.json' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + run-smoke-tests: + timeout-minutes: 15 + runs-on: ubuntu-latest + strategy: + matrix: + project: [chromium, firefox, webkit] + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js and Playwright + uses: ./.github/actions/setup-playwright + + - name: Run smoke tests + run: yarn playwright test --project=${{ matrix.project }} --grep @smoke + + - name: Upload test results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: smoke-tests-results-${{ matrix.project }}-${{ github.run_id }} + path: playwright-report/ + retention-days: 7 \ No newline at end of file