forked from nodejs/node-addon-api
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.61 KB
/
ci.yml
File metadata and controls
54 lines (52 loc) · 1.61 KB
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
name: Node.js CI Unix Platform
on: [push, pull_request]
jobs:
test:
timeout-minutes: 30
strategy:
matrix:
node-version:
- node/12
- node/14
- node/16
compiler:
- gcc
- clang
os:
- ubuntu-18.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
if [ "${{ matrix.compiler }}" = "gcc" -a "${{ matrix.os }}" = ubuntu-* ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-6.5
fi
- name: Use Node.js ${{ matrix.node-version }}
run: |
git clone --branch v1.4.2 --depth 1 https://github.com/jasongin/nvs ~/.nvs
. ~/.nvs/nvs.sh
nvs --version
nvs add ${{ matrix.node-version }}
nvs use ${{ matrix.node-version }}
node --version
npm --version
npm install
- name: npm test
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CC="gcc" CXX="g++"
fi
if [ "${{ matrix.compiler }}" = "gcc" -a "${{ matrix.os }}" = ubuntu-* ]; then
export CC="gcc-6.5" CXX="g++-6.5" AR="gcc-ar-6.5" RANLIB="gcc-ranlib-6.5" NM="gcc-nm-6.5"
fi
if [ "${{ matrix.compiler }}" = "clang" ]; then
export CC="clang" CXX="clang++"
fi
export CFLAGS="$CFLAGS -O3 --coverage" LDFLAGS="$LDFLAGS --coverage"
echo "CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
npm run pretest -- --verbose
node test