Skip to content

Commit 1d8887e

Browse files
committed
fix: fixed prebuild target (#421)
1 parent d595f0d commit 1d8887e

15 files changed

+1192
-804
lines changed

Diff for: .github/workflows/ci-build-and-test.yml

+233
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
name: Continuous Integration - Build & Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build_test_x86_64:
15+
name: Build and Test x86_64 Node v${{ matrix.node }} on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
21+
node: [12, 13, 14, 15, 16, 17]
22+
steps:
23+
- name: Checkout Project
24+
uses: actions/checkout@v3
25+
26+
- name: Add problem matcher
27+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
28+
29+
- name: Use Node.js v${{ matrix.node }}
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: ${{ matrix.node }}
33+
cache: yarn
34+
registry-url: https://registry.yarnpkg.org/
35+
36+
- name: Install Dependencies
37+
run: yarn --immutable --mode=skip-build
38+
39+
- name: Build Code
40+
run: yarn build
41+
42+
- name: Test Code
43+
run: yarn vitest run
44+
45+
build_test_x86_64_node_ge_18:
46+
name: Build and Test x86_64 node >= 18
47+
runs-on: ${{ matrix.os }}
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
52+
node: [18]
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v3
56+
57+
- name: Add problem matcher
58+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
59+
60+
- name: Use Node.js v${{ matrix.node }}
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: ${{ matrix.node }}
64+
cache: yarn
65+
registry-url: https://registry.yarnpkg.org/
66+
67+
- name: Install dependencies
68+
run: yarn --immutable --mode=skip-build
69+
70+
- name: Build From Source
71+
run: yarn gyp:build-from-source
72+
73+
- name: Package build
74+
run: yarn build
75+
76+
- name: Test Code
77+
run: yarn vitest run
78+
79+
build_test_musl_x86_64:
80+
name: Build and Test x86_64(musl)
81+
runs-on: ubuntu-latest
82+
container:
83+
image: node:${{ matrix.node }}-alpine
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
node: [12, 13, 14, 15, 16, 17, 18]
88+
steps:
89+
- name: Setup env with Node v${{ matrix.node }}
90+
run: |
91+
apk add --update
92+
apk add --no-cache ca-certificates git curl build-base python3 g++ make
93+
94+
- name: Checkout repository
95+
uses: actions/checkout@v3
96+
97+
- name: Add problem matcher
98+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
99+
100+
- name: Install dependencies
101+
run: yarn --immutable --mode=skip-build
102+
103+
- name: Build From Source
104+
run: yarn gyp:build-from-source
105+
106+
- name: Package build
107+
run: yarn build
108+
109+
- name: Test Code
110+
run: yarn vitest run
111+
112+
build_test_aarch64:
113+
name: Build and Test aarch64
114+
runs-on: ${{ matrix.os }}
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
119+
node: [12, 13, 14, 15, 16, 17]
120+
steps:
121+
- name: Checkout repository
122+
uses: actions/checkout@v3
123+
124+
- name: Add problem matcher
125+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
126+
127+
- name: Use Node.js v${{ matrix.node }}
128+
uses: actions/setup-node@v3
129+
with:
130+
node-version: ${{ matrix.node }}
131+
cache: yarn
132+
registry-url: https://registry.yarnpkg.org/
133+
134+
- name: Install dependencies
135+
run: yarn --immutable --mode=skip-build
136+
137+
- name: Build From Source
138+
run: yarn gyp:build-from-source
139+
140+
- name: Package build
141+
run: |
142+
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
143+
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ yarn node-pre-gyp --target_arch=arm64 configure build package
144+
145+
- name: Make TypeScript Build
146+
run: yarn ts:build && yarn ts:esm
147+
148+
- name: Test Code
149+
run: yarn vitest run
150+
151+
build_test_aarch64_node_ge_18:
152+
name: Build and Test aarch64 node >= 18
153+
runs-on: ${{ matrix.os }}
154+
strategy:
155+
fail-fast: false
156+
matrix:
157+
os: [ubuntu-20.04, ubuntu-22.04]
158+
node: [18]
159+
steps:
160+
- name: Checkout repository
161+
uses: actions/checkout@v3
162+
163+
- name: Add problem matcher
164+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
165+
166+
- name: Use Node.js v${{ matrix.node }}
167+
uses: actions/setup-node@v3
168+
with:
169+
node-version: ${{ matrix.node }}
170+
cache: yarn
171+
registry-url: https://registry.yarnpkg.org/
172+
173+
- name: Install dependencies
174+
run: yarn --immutable --mode=skip-build
175+
176+
- name: Build From Source
177+
run: yarn gyp:build-from-source
178+
179+
- name: Package build
180+
run: |
181+
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
182+
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ yarn node-pre-gyp --target_arch=arm64 configure build package
183+
184+
- name: Make TypeScript Build
185+
run: yarn ts:build && yarn ts:esm
186+
187+
- name: Test Code
188+
run: yarn vitest run
189+
190+
build_test_musl_aarch64:
191+
name: Build and Test aarch64(musl)
192+
runs-on: ubuntu-latest
193+
container:
194+
image: node:${{ matrix.node }}-alpine
195+
strategy:
196+
fail-fast: false
197+
matrix:
198+
node: [12, 13, 14, 15, 16, 17, 18]
199+
steps:
200+
- name: Setup env with Node v${{ matrix.node }}
201+
run: |
202+
apk add --update
203+
apk add --no-cache ca-certificates git curl build-base python3 g++ make
204+
205+
- name: Checkout repository
206+
uses: actions/checkout@v3
207+
208+
- name: Add problem matcher
209+
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
210+
211+
- name: Setup musl cross compiler
212+
run: |
213+
curl -OL https://musl.cc/aarch64-linux-musl-cross.tgz
214+
tar -xzvf aarch64-linux-musl-cross.tgz
215+
$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version
216+
217+
- name: Install dependencies
218+
run: yarn --immutable --mode=skip-build
219+
220+
- name: Build From Source
221+
run: yarn gyp:build-from-source
222+
223+
- name: Package build
224+
run: |
225+
CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \
226+
CXX=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-g++ \
227+
yarn node-pre-gyp --target_arch=arm64 configure build package
228+
229+
- name: Make TypeScript Build
230+
run: yarn ts:build && yarn ts:esm
231+
232+
- name: Test Code
233+
run: yarn vitest run

Diff for: .github/workflows/ci-lint-and-docs.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Continuous Integration - Lint & Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
Linting:
15+
name: Linting
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Project
19+
uses: actions/checkout@v3
20+
- name: Add problem matcher
21+
run: echo "::add-matcher::.github/problemMatchers/eslint.json"
22+
- name: Use Node.js v18
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 18
26+
cache: yarn
27+
registry-url: https://registry.yarnpkg.org/
28+
- name: Install Dependencies
29+
run: yarn --immutable
30+
- name: Run ESLint
31+
run: yarn lint --fix=false
32+
33+
docs:
34+
name: Generate Documentation
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout Project
38+
uses: actions/checkout@v3
39+
- name: Use Node.js v18
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: 18
43+
cache: yarn
44+
registry-url: https://registry.npmjs.org/
45+
- name: Install Dependencies
46+
run: yarn --immutable
47+
- name: Generate Documentation
48+
run: yarn docs

Diff for: .github/workflows/continuous-integration.yml

-115
This file was deleted.

0 commit comments

Comments
 (0)