Skip to content

Commit 643714a

Browse files
authored
Move all continuous integration to GitHub Actions (#942)
Signed-off-by: Jon Koops <[email protected]>
1 parent 418c11f commit 643714a

File tree

5 files changed

+116
-75
lines changed

5 files changed

+116
-75
lines changed

.github/actions/setup/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Set up workspace
2+
description: Sets up the workspace by installing Node.js and dependencies.
3+
4+
inputs:
5+
node-version:
6+
description: The Node.js version to install.
7+
required: false
8+
default: "lts/*"
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Install Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: ${{ inputs.node-version }}
17+
cache: npm
18+
19+
- name: Install dependencies
20+
# Because the lockfile is not compatible between all supported Node.js versions we need to run `npm install`.
21+
# When support for older versions of Node.js is dropped, this can be changed to `npm ci`.
22+
run: npm install
23+
shell: bash

.github/workflows/benchmark.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Benchmark
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
benchmark:
7+
name: Run benchmark
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Set up workspace
14+
uses: ./.github/actions/setup
15+
16+
- name: Install browsers
17+
run: npx playwright install --with-deps
18+
19+
- name: Run benchmark
20+
run: npm run benchmark | tee benchmark.txt
21+
22+
- name: Download previous benchmark data
23+
uses: actions/cache@v4
24+
with:
25+
path: ./cache
26+
key: ${{ runner.os }}-benchmark
27+
28+
- name: Store benchmark result
29+
uses: benchmark-action/github-action-benchmark@v1
30+
with:
31+
tool: benchmarkjs
32+
output-file-path: benchmark.txt
33+
external-data-json-path: ./cache/benchmark-data.json
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
alert-threshold: 150%
36+
comment-on-alert: true
37+
fail-on-alert: true
38+
alert-comment-cc-users: "@Stuk"

.github/workflows/main.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
lint:
9+
name: Lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up workspace
16+
uses: ./.github/actions/setup
17+
18+
- name: Run linter
19+
run: npm run lint
20+
21+
test-node:
22+
name: Test on Node.js ${{ matrix.node-version }}
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
node-version: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up workspace
33+
uses: ./.github/actions/setup
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
37+
- name: Run tests
38+
run: npm run test-node
39+
40+
test-browser:
41+
name: Test in browser
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
47+
- name: Set up workspace
48+
uses: ./.github/actions/setup
49+
50+
- name: Install browsers
51+
run: npx playwright install --with-deps
52+
53+
- name: Run tests
54+
run: npm run test-browser
55+

.github/workflows/pr.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)