Skip to content
Go back

Running and Testing GitHub Actions Locally and in CI

Edit page

Running and Testing GitHub Actions Locally and in CI

Question: Run github actions locally

You can run GitHub Actions locally using the act tool. This helps test workflows before pushing to GitHub.

Steps:

  1. Install act:
    brew install act
  2. Run your actions:
    act
  3. Simulate different events:
    act push
    act pull_request

Tips:

Question: Set github actions with bun

Bun can be used as the runtime in your GitHub Actions workflow by configuring the action to use a setup step like:

- uses: oven-sh/setup-bun@v1
  with:
    bun-version: "latest"

Tips:

Question: Whats the best way to run e2e test of a webapp in github actions

Use a headless browser like Chrome and a test runner like Puppeteer or Playwright.

Sample GitHub Action step:

- name: Run e2e tests
  run: bun test:e2e

Tips:

Question: Give me for puppeteer

To run Puppeteer tests:

  1. Install Puppeteer:

    bun add puppeteer
  2. Create a test:

    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto("http://localhost:3000");
  3. Run in CI with xvfb or headless mode.

Tips:


Edit page
Share this post on:

Previous Post
Running Vite Preview and Using Bun for Background Processes
Next Post
Useful Tools and CSS Practices in React