-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (69 loc) · 2.9 KB
/
test.yaml
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
76
77
78
79
80
81
82
83
84
85
name: Tests
on: [push, pull_request]
env:
CI: true
jobs:
run:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [16.x, 18.x]
os: [ubuntu-latest, windows-latest]
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Install system dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev
- name: Install system dependencies (Windows)
if: startsWith(matrix.os, 'windows')
run: |
Invoke-WebRequest "https://ftp-osl.osuosl.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip" -OutFile "gtk.zip"
Expand-Archive gtk.zip -DestinationPath "C:\GTK"
Invoke-WebRequest "https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.4/libjpeg-turbo-2.0.4-vc64.exe" -OutFile "libjpeg.exe" -UserAgent NativeHost
.\libjpeg.exe /S
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Set up npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.OS }}-node-v${{ matrix.node }}-
- name: Install npm dependencies
run: npm ci
- name: Run tests
run: npm run lint && npm run test:cov
- name: Run Coveralls
uses: coverallsapp/github-action@master
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '18')
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: 'BrowserStack Env Setup'
uses: browserstack/github-actions/setup-env@master
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '18')
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: 'BrowserStack Local Tunnel Setup'
uses: browserstack/github-actions/setup-local@master
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '18')
with:
local-testing: start
local-identifier: random
- name: 'Running test on BrowserStack'
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '18')
run: npx browserstack-runner
- name: 'BrowserStackLocal Stop'
uses: browserstack/github-actions/setup-local@master
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '18')
with:
local-testing: stop