Skip to content

v5.0.1 Dynamically import puppeteer #396

v5.0.1 Dynamically import puppeteer

v5.0.1 Dynamically import puppeteer #396

Workflow file for this run

# .github/workflows/build.yml
name: Build and Test
on:
push:
paths-ignore:
- '.github/**'
- 'README.md'
- 'LICENSE.md'
pull_request:
paths-ignore:
- '.github/**'
- 'README.md'
- 'LICENSE.md'
jobs:
test-node:
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm' # Add caching for npm dependencies
- name: Install Puppeteer Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-6 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxtst6 libnss3 libglib2.0-0 libgtk-3-0t64 \
libasound2t64 libxrandr2 libpangocairo-1.0-0 libatk1.0-0 \
libatk-bridge2.0-0 libcups2 libdbus-1-3 libdrm2 libgbm1 \
libgdk-pixbuf2.0-0
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Run tests
run: npm run test:ci
- name: Generate and upload coverage report
if: matrix.node-version == '22.x' # Only run coverage on the latest LTS version
run: npm run coverage
- name: Upload coverage to Coveralls
if: matrix.node-version == '22.x'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov
if: matrix.node-version == '22.x'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ matrix.node-version == '22.x' && !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# --- Test on the Bun runtime ---
test-bun:
name: Test on Bun
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest # Or a specific version
# Caching is enabled by default with setup-bun
- name: Install Puppeteer Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libx11-6 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxtst6 libnss3 libglib2.0-0 libgtk-3-0t64 \
libasound2t64 libxrandr2 libpangocairo-1.0-0 libatk1.0-0 \
libatk-bridge2.0-0 libcups2 libdbus-1-3 libdrm2 libgbm1 \
libgdk-pixbuf2.0-0
- name: Install dependencies
run: bun install
- name: Run tests with Bun
run: bun run test:ci