v5.0.0 SPA support. #389
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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 -yq libgconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget | |
- 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 -yq libgconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget | |
- name: Install dependencies | |
run: bun install | |
- name: Run tests with Bun | |
run: bun run test:ci |