Repository navigation
207 lines (174 loc) · 6.87 KB
/
Copy pathci.yml
File metadata and controls
207 lines (174 loc) · 6.87 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: macos-26
steps:
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install Dependencies
run: npm install
- name: Check FFI backend boundaries
run: npm run check:ffi-boundaries
- name: Test React Native package
run: npm run test:react-native
- name: Download V8
run: ./scripts/download_v8.sh
- name: Install libffi build tools
run: brew install autoconf automake libtool texinfo
- name: Build libffi
run: npm run build-libffi
- name: Build metadata generator
run: METADATA_GENERATOR_ARCHS="$(uname -m)" npm run build-metagen
- name: Generate macOS metadata
run: npm run metagen macos
- name: Apply QuickJS patches
# vendor/quickjs/source_ng is a pristine submodule checkout at its pinned
# commit; the NativeScript engine changes the Apple build needs (e.g.
# JS_EVAL_FLAG_COMPILE_ONLY_NO_RESOLVE for node:vm) live in
# vendor/quickjs/patches and are applied into the work tree here.
run: npm run patch-quickjs
- name: Build NativeScript
run: npm run build
- name: Build CLI
run: npm run build:macos-cli
- name: Run Tests on macOS
run: npm run test:macos
- name: Run Tests on iOS
env:
IOS_BUILD_TIMEOUT_MS: "600000"
IOS_TEST_TIMEOUT_MS: "600000"
IOS_TEST_INACTIVITY_TIMEOUT_MS: "180000"
IOS_LOG_JUNIT: "1"
IOS_TEST_VERBOSE_SPECS: "1"
IOS_SIMCTL_QUERY_TIMEOUT_MS: "10000"
run: npm run test:ios
engine-tests:
name: macOS tests (${{ matrix.engine }})
runs-on: macos-26
strategy:
fail-fast: false
matrix:
engine: [hermes, quickjs, jsc]
steps:
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install dependencies
run: npm install
- name: Install libffi build tools
run: brew install autoconf automake libtool texinfo
- name: Build libffi
run: npm run build-libffi
- name: Build metadata generator
run: METADATA_GENERATOR_ARCHS="$(uname -m)" npm run build-metagen
- name: Generate macOS metadata
run: npm run metagen macos
- name: Apply QuickJS patches
run: npm run patch-quickjs
- name: Run macOS test suite
env:
MACOS_COMMAND_TIMEOUT_MS: "1200000"
MACOS_LOG_JUNIT: "1"
MACOS_TEST_ENGINE: ${{ matrix.engine }}
MACOS_TEST_INACTIVITY_TIMEOUT_MS: "180000"
MACOS_TEST_TIMEOUT_MS: "600000"
MACOS_TEST_VERBOSE_SPECS: "1"
run: npm run test:macos -- ./build/test-results/macos-${{ matrix.engine }}-junit.xml
- name: Run iOS test suite
env:
IOS_BUILD_TIMEOUT_MS: "1200000"
IOS_LOG_JUNIT: "1"
IOS_SIMCTL_QUERY_TIMEOUT_MS: "10000"
IOS_TEST_ENGINE: ${{ matrix.engine }}
IOS_TEST_INACTIVITY_TIMEOUT_MS: "180000"
IOS_TEST_TIMEOUT_MS: "600000"
IOS_TEST_VERBOSE_SPECS: "1"
run: npm run test:ios -- ./build/test-results/ios-${{ matrix.engine }}-junit.xml
performance:
name: Performance (${{ matrix.engine }})
if: github.event_name == 'pull_request' && github.base_ref != 'main'
runs-on: macos-26
strategy:
fail-fast: false
matrix:
engine: [v8, hermes, quickjs, jsc]
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
CANDIDATE_SHA: ${{ github.event.pull_request.head.sha }}
ENGINE: ${{ matrix.engine }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
submodules: 'recursive'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install dependencies
run: npm install
- name: Install libffi build tools
run: brew install autoconf automake libtool texinfo
- name: Build shared dependencies
run: |
npm run build-libffi
METADATA_GENERATOR_ARCHS="$(uname -m)" npm run build-metagen
npm run metagen macos
npm run patch-quickjs
- name: Build candidate CLI
run: |
./scripts/build_nativescript.sh --no-iphone --no-simulator --no-macos --macos-cli --${ENGINE}
cp ./dist/nsr "${RUNNER_TEMP}/nsr-candidate-${ENGINE}"
cp "./metadata-generator/metadata/metadata.macos.$(uname -m).nsmd" "${RUNNER_TEMP}/metadata-candidate-${ENGINE}.nsmd"
- name: Build base CLI
run: |
# Candidate and base can pin different engine releases and CMake
# layouts. Their ignored build/framework outputs must not bleed into
# one another when both revisions are built in this checkout.
rm -rf ./dist/intermediates/macos ./dist/NativeScript.xcframework
case "${ENGINE}" in
v8)
rm -rf ./Frameworks/libv8_monolith.xcframework
;;
hermes)
rm -rf ./Frameworks/hermes.xcframework ./Frameworks/hermes-headers
;;
esac
# A base that still vendors QuickJS-NG as plain files can't be
# checked out over the candidate's submodule work tree.
git submodule deinit --force vendor/quickjs/source_ng
git checkout --detach "${BASE_SHA}"
git submodule update --init --recursive
if [ -d vendor/quickjs/patches ]; then npm run patch-quickjs; fi
npm install
npm run build-libffi
METADATA_GENERATOR_ARCHS="$(uname -m)" npm run build-metagen
npm run metagen macos
./scripts/build_nativescript.sh --no-iphone --no-simulator --no-macos --macos-cli --${ENGINE}
cp ./dist/nsr "${RUNNER_TEMP}/nsr-baseline-${ENGINE}"
cp "./metadata-generator/metadata/metadata.macos.$(uname -m).nsmd" "${RUNNER_TEMP}/metadata-baseline-${ENGINE}.nsmd"
git checkout --detach "${CANDIDATE_SHA}"
git submodule update --init --recursive
- name: Compare Objective-C dispatch performance
run: |
npm run benchmark:objc-dispatch:cli:compare -- \
--engine "${ENGINE}" \
--baseline-binary "${RUNNER_TEMP}/nsr-baseline-${ENGINE}" \
--baseline-metadata "${RUNNER_TEMP}/metadata-baseline-${ENGINE}.nsmd" \
--candidate-binary "${RUNNER_TEMP}/nsr-candidate-${ENGINE}" \
--candidate-metadata "${RUNNER_TEMP}/metadata-candidate-${ENGINE}.nsmd" \
--output "./build/benchmarks/objc-dispatch-${ENGINE}.json"