-
Notifications
You must be signed in to change notification settings - Fork 63
75 lines (65 loc) · 2.03 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Run tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
DEBIAN_FRONTEND: noninteractive
concurrency:
# cancel jobs on PRs only
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: Test on ${{ matrix.os }} ${{ matrix.platform }} (NodeJS ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-22.04"
- "ubuntu-20.04"
- "macos-12"
platform: ["x86_64"]
node-version: ["16", "18"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
curl \
wget \
libcairo2-dev \
libgles2-mesa-dev \
libgbm-dev \
libllvm11 \
libuv1-dev \
libprotobuf-dev \
libxxf86vm-dev \
xvfb \
x11-utils
wget --no-verbose http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2.1_amd64.deb
sudo apt-get install -y ./libicu66_66.1-2ubuntu2.1_amd64.deb
- run: |
npm ci
npm install coveralls
- name: test on Linux
if: runner.os == 'Linux'
run: |
xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +render -noreset" \
npx jest --silent --coverage tests
- name: test on MacOS
if: runner.os == 'macos'
run: npx jest --silent --coverage tests
- name: Coveralls
if: runner.os == 'Linux'
run: curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}