-
Notifications
You must be signed in to change notification settings - Fork 135
81 lines (67 loc) · 2.51 KB
/
ci.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
76
77
78
79
80
81
#
# GitHub Actions Workflow
# reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
# useful example: https://github.com/mikeal/bundle-size-action/blob/master/.github/workflows/mikeals-workflow.yml
#
name: CI
on: [ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# https://github.com/actions/runner-images#available-images
# macos-latest-large is x64
# macos-latest is arm64
os: [ ubuntu-latest, windows-latest ]
node-version: [ 8.x, 10.x, 12.x, 13.x, 14.x, 16.x, 18.x, 20.x ]
exclude:
# exclude Node.js 8.x on ubuntu-latest
# node-gyp fails during in gyp's Python code:
# AttributeError: module 'collections' has no attribute 'MutableSet'
# TODO: try to fix
- os: ubuntu-latest
node-version: 8.x
# temporarily exclude Node.js 8.x-14.x on windows-latest
# node-gyp cannot find compatible Microsoft Visual Studio
# TODO: try to fix (install manually an older MVS)
- os: windows-latest
node-version: 8.x
- os: windows-latest
node-version: 10.x
- os: windows-latest
node-version: 12.x
- os: windows-latest
node-version: 13.x
- os: windows-latest
node-version: 14.x
include:
# macos-latest is arm64 which supports only the latest Node.js versions
- os: macos-latest
node-version: 18.x
- os: macos-latest
node-version: 20.x
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
# https://github.com/actions/setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pcsclite
run: sudo apt-get install -y libpcsclite1 libpcsclite-dev pcscd
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies
run: npm install --verbose
- name: Build dist
run: npm run build
- name: Run basic test
run: node test/_node-version-test.js
- name: Run tests
run: npm test
# TODO: enable once tests do not get stuck on Windows
# AVA supports only officially supported Node.js versions
if: matrix.os != 'windows-latest' && contains(fromJSON('["18.x", "20.x"]'), matrix.node-version)