Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Set up workspace
description: Sets up the workspace by installing Node.js and dependencies.

inputs:
node-version:
description: The Node.js version to install.
required: false
default: "lts/*"

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: npm

- name: Install dependencies
# Because the lockfile is not compatible between all supported Node.js versions we need to run `npm install`.
# When support for older versions of Node.js is dropped, this can be changed to `npm ci`.
run: npm install
shell: bash
38 changes: 38 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Benchmark
on:
push:
branches: [main]
jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up workspace
uses: ./.github/actions/setup

- name: Install browsers
run: npx playwright install --with-deps

- name: Run benchmark
run: npm run benchmark | tee benchmark.txt

- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: benchmarkjs
output-file-path: benchmark.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: 150%
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: "@Stuk"
55 changes: 55 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up workspace
uses: ./.github/actions/setup

- name: Run linter
run: npm run lint

test-node:
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}

- name: Run tests
run: npm run test-node

test-browser:
name: Test in browser
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up workspace
uses: ./.github/actions/setup

- name: Install browsers
run: npx playwright install --with-deps

- name: Run tests
run: npm run test-browser

58 changes: 0 additions & 58 deletions .github/workflows/pr.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.