-
-
Notifications
You must be signed in to change notification settings - Fork 100
156 lines (146 loc) · 5.81 KB
/
Copy pathpush.yml
File metadata and controls
156 lines (146 loc) · 5.81 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: on push or pull_request
concurrency:
group: push-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node:
- version: 14.x
- version: 16.x
- version: 18.x
- version: 20.x
# These error with "Unexpected input(s) 'node-mirror' ...":
# - version: 19.x
# mirror: https://nodejs.org/download/nightly
# - version: 19.x
# mirror: https://nodejs.org/download/v8-canary
# os: [ubuntu-latest, macos-latest]
# Temporarily disable MacOS until
# https://github.com/nodejs/node/issues/32981 is fixed
# TODO(mmarchini): test on 20.04 (need different lldb version)
os: [ubuntu-20.04, ubuntu-22.04]
llvm: [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
exclude:
# Neither LLVM nor Canonical package these versions for Jammy
- {os: ubuntu-22.04, llvm: 8}
- {os: ubuntu-22.04, llvm: 9}
- {os: ubuntu-22.04, llvm: 10}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node.version }} ${{ matrix.node.mirror }}
uses: No9/setup-node@mirror
with:
node-version: ${{ matrix.node.version }}
# TODO(mmarchini): re-enable once mirror is supported on setup-node
node-mirror: ${{ matrix.node.mirror }}
- name: install dependencies Linux
if: startsWith(matrix.os, 'ubuntu-')
run: |
use_llvm_repos=1
case "${{ matrix.os }}" in
ubuntu-20.04)
case "${{ matrix.llvm }}" in
8) use_llvm_repos=0;;
9) use_llvm_repos=0;;
10) use_llvm_repos=0;;
11) use_llvm_repos=0;;
12) use_llvm_repos=0;;
*) use_llvm_repos=1;;
esac
;;
ubuntu-22.04)
case "${{ matrix.llvm }}" in
11) use_llvm_repos=0;;
12) use_llvm_repos=0;;
13) use_llvm_repos=0;;
14) use_llvm_repos=0;;
15) use_llvm_repos=0;;
*) use_llvm_repos=1;;
esac
;;
*) use_llvm_repos=1;;
esac
if [[ ${use_llvm_repos} == 1 ]]; then
llvm_suffix="-${{ matrix.llvm }}";
# If there's no `release/XY.x` branch, check if this is current dev release
if ! git ls-remote --exit-code --heads \
https://github.com/llvm/llvm-project.git \
refs/heads/release/${{ matrix.llvm }}.x >/dev/null 2>&1; then
# If there's an `llvmorg-XY-init` tag, this is the current dev release
if git ls-remote --exit-code --tags \
https://github.com/llvm/llvm-project.git \
refs/tags/llvmorg-${{ matrix.llvm }}-init >/dev/null 2>&1; then
# The dev release doesn't use a version suffix
llvm_suffix="";
fi
fi
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -;
release="$(lsb_release -cs)"
cat << EOF | sudo tee /etc/apt/sources.list.d/llvm${llvm_suffix}.list
deb http://apt.llvm.org/${release}/ llvm-toolchain-${release}${llvm_suffix} main
deb-src http://apt.llvm.org/${release}/ llvm-toolchain-${release}${llvm_suffix} main
EOF
fi
sudo apt-get -qq update
sudo apt-get install -y --no-install-recommends \
lcov gdb \
lldb-${{ matrix.llvm }} \
liblldb-${{ matrix.llvm }}-dev
if [[ -n "$(which lldb-${{ matrix.llvm }})" ]]; then
sudo ln -s "$(which lldb-${{ matrix.llvm }})" /usr/bin/lldb
python_version="$(python3 --version 2>&1 | cut -d' ' -f2 | cut -d'.' -f3 --complement)";
# Is `/usr/lib/lib` here correct?
sudo mkdir -p /usr/lib/lib/python${python_version}
sudo ln -s /usr/lib/llvm-${{ matrix.llvm }}/lib/python${python_version}/site-packages /usr/lib/lib/python${python_version}/site-packages
fi
if [[ -n "$(which llvm-config-${{ matrix.llvm }})" ]]; then
sudo ln -s "$(which llvm-config-${{ matrix.llvm }})" /usr/bin/llvm-config
fi
echo "/usr/lib/llvm-${{ matrix.llvm }}/lib" | sudo tee /etc/ld.so.conf.d/llvm.conf
sudo ldconfig
- name: npm install
run: |
npm install --llnode_build_addon=true --llnode_coverage=true
- name: run tests
run: TEST_LLDB_BINARY=`which lldb-${{ matrix.llvm }}` npm run nyc-test-all
if: matrix.node.version != '19.x'
- name: run tests (nightly)
run: TEST_LLDB_BINARY=`which lldb-${{ matrix.llvm }}` npm run nyc-test-all
if: matrix.node.version == '19.x'
continue-on-error: true
- name: prepare coverage
if: startsWith(matrix.os, 'ubuntu-') && matrix.node.version != '19.x'
run: |
npm run coverage
cat ./coverage-js.info > ./coverage.info
cat ./coverage-cc.info >> ./coverage.info
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.info
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: npm install, build, and test
run: |
sudo apt-get -qq update
sudo apt-get install lldb-11 liblldb-11-dev lcov -y
sudo ln -s $(which lldb-11) /usr/bin/lldb
npm install
npm run linter