forked from ApsarasX/llvm-bindings
-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (74 loc) · 2.24 KB
/
build.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
name: Build
on:
push:
branches:
- '**'
paths-ignore:
- '*.md'
- 'LICENSE'
tags-ignore:
- '**'
pull_request:
branches:
- '**'
paths-ignore:
- '*.md'
- 'LICENSE'
tags-ignore:
- '**'
env:
LLVM_VERSION: 14.0.6
LLVM_VERSION_MAJOR: 14
jobs:
build:
name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022 ]
node: [ 18, 20 ]
exclude:
- os: ubuntu-18.04
node: 18
steps:
- name: Fetch Codebase
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Install LLVM and Ninja on macOS
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install llvm@${{ env.LLVM_VERSION_MAJOR }} ninja
- name: Install LLVM and Ninja on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh ${{ env.LLVM_VERSION_MAJOR }}
sudo apt-get install ninja-build
- name: Install LLVM on Windows
if: startsWith(matrix.os, 'windows')
run: |
$LLVM_VERSION = "${{ env.LLVM_VERSION }}"
$LLVM_PREBUILT_FILE = "llvm-$LLVM_VERSION-${{ matrix.os }}.zip"
curl -sLO https://github.com/ApsarasX/llvm-windows/releases/download/llvmorg-$LLVM_VERSION/$LLVM_PREBUILT_FILE
Expand-Archive -Path $LLVM_PREBUILT_FILE -DestinationPath .
$LLVM_CMAKE_DIR = "$pwd\\LLVM-$LLVM_VERSION-win64\\lib\\cmake\\llvm"
echo "cmake_LLVM_DIR=$LLVM_CMAKE_DIR"> .npmrc
- name: Install Dependencies
run: npm install --ignore-scripts
- name: CMake Build Debug and Test
if: startsWith(matrix.os, 'windows') == false
run: |
npm run clear
npm run build:debug
npm test
- name: CMake Build Release and Test
run: |
npm run clear
npm run build:release
npm test