-
Notifications
You must be signed in to change notification settings - Fork 33
137 lines (137 loc) · 4.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI (GitHub)
on:
- push
- pull_request
permissions: {}
jobs:
CI:
permissions:
contents: write
name: ${{ matrix.container || matrix.os }} - Node.js ${{ matrix.nodejs_version }} ${{ matrix.nodejs_arch }} ${{ matrix.prebuild && '- prebuild' }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
container: centos:7
nodejs_version: 10
prebuild: true
- os: ubuntu-22.04
container: centos:7
nodejs_version: 12
- os: ubuntu-22.04
container: centos:7
nodejs_version: 14
- os: ubuntu-22.04
container: centos:7
nodejs_version: 16
- os: ubuntu-22.04
container: rockylinux:8
nodejs_version: 18
- os: ubuntu-22.04
container: node:10-alpine3.11
prebuild: true
- os: ubuntu-22.04
container: node:12-alpine3.12
- os: ubuntu-22.04
container: node:14-alpine3.12
- os: ubuntu-22.04
container: node:16-alpine3.12
- os: ubuntu-22.04
container: node:18-alpine3.14
- os: macos-12
nodejs_version: 10
nodejs_arch: x64
prebuild: true
- os: macos-12
nodejs_version: 12
nodejs_arch: x64
- os: macos-12
nodejs_version: 14
nodejs_arch: x64
- os: macos-12
nodejs_version: 16
nodejs_arch: x64
- os: macos-12
nodejs_version: 18
nodejs_arch: x64
- os: macos-14
nodejs_version: 18
nodejs_arch: arm64
prebuild: true
- os: windows-2019
nodejs_version: 10
nodejs_arch: x86
prebuild: true
- os: windows-2019
nodejs_version: 12
nodejs_arch: x86
- os: windows-2019
nodejs_version: 14
nodejs_arch: x86
- os: windows-2019
nodejs_version: 16
nodejs_arch: x86
- os: windows-2019
nodejs_version: 18
nodejs_arch: x86
- os: windows-2019
nodejs_version: 10
nodejs_arch: x64
prebuild: true
- os: windows-2019
nodejs_version: 12
nodejs_arch: x64
- os: windows-2019
nodejs_version: 14
nodejs_arch: x64
- os: windows-2019
nodejs_version: 16
nodejs_arch: x64
- os: windows-2019
nodejs_version: 18
nodejs_arch: x64
steps:
- name: Dependencies (Linux glibc)
if: contains(matrix.container, 'centos')
run: |
curl -sL https://rpm.nodesource.com/setup_${{ matrix.nodejs_version }}.x | bash -
yum install -y centos-release-scl
yum install -y devtoolset-11-gcc-c++ make git python3 nodejs
echo "/opt/rh/devtoolset-11/root/usr/bin" >> $GITHUB_PATH
- name: Dependencies (Rocky Linux glibc)
if: contains(matrix.container, 'rockylinux')
run: |
curl -sL https://rpm.nodesource.com/setup_${{ matrix.nodejs_version }}.x | bash -
dnf install -y gcc-toolset-11-gcc-c++ make git python3 nodejs
echo "/opt/rh/gcc-toolset-11/root/usr/bin" >> $GITHUB_PATH
- name: Dependencies (Linux musl)
if: contains(matrix.container, 'alpine')
run: apk add build-base git python3 --update-cache
- name: Dependencies (Python 3.10 - macOS, Windows)
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Dependencies (Node.js - macOS, Windows)
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs_version }}
architecture: ${{ matrix.nodejs_arch }}
- name: Add compiler flags
if: matrix.os != 'macos-14'
run: echo "CXXFLAGS=-march=nehalem" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Install
run: npm install --build-from-source --unsafe-perm
- name: Test
run: npm test
- name: Prebuild
if: matrix.prebuild && startsWith(github.ref, 'refs/tags/')
env:
prebuild_upload: ${{ secrets.GITHUB_TOKEN }}
run: npx prebuild --runtime napi --target 3