# Quick Start

{% hint style="info" %}
Check out the example repository [https://github.com/currents-dev/currents-examples](https://github.com/currents-dev/currents-examples/tree/main/playwright/ci/github-actions)
{% endhint %}

### Quick Start

The example workflow file below shows how to run Playwright tests in GitHub actions.

<pre class="language-yaml"><code class="lang-yaml">name: Run Playwright Tests
on:
  pull_request:
    branches: [main]
jobs:
  run-tests:
    name: "Playwright Tests"
    timeout-minutes: 60
    runs-on: ubuntu-22.04
    container: <code class="expression">space.vars.PW_IMAGE_ROUTE + ":" + space.vars.LATEST_PW_IMAGE_VERSION</code>

    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      # https://github.com/actions/runner-images/issues/6775
      - run: |
          echo "$GITHUB_WORKSPACE"
          git config --global --add safe.directory "$GITHUB_WORKSPACE"

      - uses: actions/setup-node@v4
        with:
          node-version: "24.x"

      - name: Install dependencies
        run: npm ci

      - name: Playwright Tests
        continue-on-error: false
        env:
          CURRENTS_PROJECT_ID: ${{ vars.CURRENTS_PROJECT_ID }}
          CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
        run: npx playwright test
</code></pre>

The workflow above is the simplest way to get started. As the test suite grows, parallelization helps keep execution time fast.

### Parallelization

The [GitHub Actions matrix execution strategy](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) can create multiple containers that run Playwright tests in parallel.

Each container receives a unique set of tests. This makes the browser test suite finish faster and gives feedback sooner.

<figure><img src="/files/8ZAetkXmthHKtz1KIulH" alt="Tests Parallelization with Github Actions"><figcaption><p>Tests Parallelization with Github Actions</p></figcaption></figure>

This can be done with [Playwright Sharding](https://playwright.dev/docs/test-sharding). Playwright can split tests between multiple CI machines using the `--shard` CLI flag. The examples below show how to set up sharding and orchestration.

{% hint style="info" %}
Looking for more ways to speed up CI? Read our [CI Optimization](/guides/ci-optimization.md) page.
{% endhint %}

### Examples

The [example repository](https://github.com/currents-dev/currents-examples/tree/main/playwright/ci/github-actions) showcases running Playwright tests in GitHub Actions. We've included several config files to exemplify the workflows:

* [test-basic-pwc.yml](https://github.com/currents-dev/currents-examples/blob/main/playwright/ci/github-actions/.github/workflows/test-basic-pwc.yml) - run Playwright tests in parallel using 3 shards of GitHub Actions Matrix and `pwc` command.
* [test-basic-reporter.yml](https://github.com/currents-dev/currents-examples/blob/main/playwright/ci/github-actions/.github/workflows/test-basic-reporter.yml) - run Playwright tests in parallel run using 3 shards of GitHub Actions Matrix and configuring Currents Reporter in `playwright.config.ts`.
* [test-or8n.yml](https://github.com/currents-dev/currents-examples/blob/main/playwright/ci/github-actions/.github/workflows/test-or8n.yml) - run Playwright tests in parallel Playwright using [Orchestration Setup](/guides/ci-optimization/playwright-orchestration.md) and GitHub Actions Matrix. Currents Orchestration speeds up CI runs by up to 40% (compared to native sharding) by optimally balancing tests between the available machines.
* [reruns-or8n.yml](https://github.com/currents-dev/currents-examples/blob/main/playwright/ci/github-actions/.github/workflows/reruns-or8n.yml) - Orchestration failed-only reruns.
* [argos-example.yml](https://github.com/currents-dev/currents-examples/blob/main/playwright/ci/github-actions/.github/workflows/argos-example.yml) - run Playwright tests in parallel using Currents Orchestration, use Argos CI for visual testing.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.currents.dev/getting-started/ci-setup/github-actions/playwright-github-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
