-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.55 KB
/
tests.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
name: 'Test Extension'
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
test_command: xvfb-run -a npm test
npm_cache_dir: ~/.npm
- os: windows-latest
test_command: npm test
npm_cache_dir: ~\AppData\Local\npm-cache
- os: macOS-latest
test_command: npm test
npm_cache_dir: ~/.npm
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '18.17.1'
- name: Cache npm packages
id: cache-npm
uses: actions/cache@v3
env:
cache-name: npm-cache
with:
path: ${{ matrix.npm_cache_dir }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install npm packages
run: npm ci
- name: Install & Cache apt packages
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential xvfb clang libdbus-1-dev libgtk-3-dev libnotify-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib curl gperf bison python3-dbusmock openjdk-8-jre
version: 1.0
- name: Run tests
run: ${{ matrix.test_command }}