forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
699 lines (662 loc) · 24.8 KB
/
config.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
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
version: 2.1
# The Linux jobs include hacks and flags that restricts parallelism, and re-try
# with less parallelism on failure.
#
# This is because CircleCI Linux jobs have 2 CPUs and 4GB RAM allocated via
# cgroups, but run on machines that advertise 36 CPUs and 68GB RAM. This means
# that most build tools will spawn 36 jobs and quickly choke to death. Even
# with just 4 jobs, 4GB may be too little, so we retry serially on failure.
#
# Comments saying "see top comment" refer to this.
orbs:
win: circleci/windows@2.4.0
android: circleci/android@1.0.3
workflows:
version: 2
build:
jobs:
- android
- linux
- build-apple-runtime
- test-macos
- test-apple-runtime:
requires:
- build-apple-runtime
- package-apple-runtime:
requires:
- test-macos
- test-apple-runtime
- windows
- npm:
requires:
- android
- linux
- package-apple-runtime
- windows
- test-emscripten
- test-linux
- test-e2e:
requires:
- npm
- test-e2e-intl
# Default settings for Apple jobs (apple-runtime, test-apple-runtime)
apple_defaults: &apple_defaults
macos:
xcode: 12.4.0
working_directory: ~/hermes
environment:
- TERM: dumb
- HERMES_WS_DIR: /tmp/hermes
# Homebrew currently breaks while updating:
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
- HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
android:
executor:
name: android/android
sdk-version: '28'
variant: ndk
environment:
- HERMES_WS_DIR: /tmp/hermes
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
steps:
- checkout
- run:
name: Set up workspace and install dependencies
command: |
yes | sdkmanager "cmake;3.10.2.4988404" &
mkdir -p "$HERMES_WS_DIR" "$HERMES_WS_DIR/output"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
sudo apt-get update
sudo apt-get install -y cmake ninja-build libicu-dev
wait
sudo cp /usr/bin/ninja /usr/bin/ninja.real
# See top comment
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
ln -sf /usr/bin/ninja /opt/android/sdk/cmake/3.10.2.4988404/bin/ninja
- run:
name: Build Hermes Compiler
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py ./build
# Build the Hermes compiler so that the cross compiler build can
# access it to build the VM
cmake --build ./build --target hermesc
- run:
name: Build Hermes for Android
command: |
export ANDROID_SDK="$ANDROID_HOME"
export ANDROID_NDK="$ANDROID_HOME/ndk-bundle"
cd "$HERMES_WS_DIR/hermes/android" && ./gradlew githubRelease
- run:
name: Copy artifacts
command: |
cd "$HERMES_WS_DIR"
cp "build_android/distributions"/hermes-runtime-android-*.tar.gz "output"
- run:
name: Checksum artifacts
command: |
cd "$HERMES_WS_DIR/output"
for file in *
do
sha256sum "$file" > "$file.sha256"
done
- store_artifacts:
path: /tmp/hermes/output/
- persist_to_workspace:
root: /tmp/hermes/output/
paths:
- .
linux:
docker:
- image: debian:stretch
environment:
- HERMES_WS_DIR: /tmp/hermes
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
steps:
- run:
name: Install dependencies
command: |
apt-get update
apt-get install -y \
sudo git openssh-client cmake ninja-build python \
build-essential libreadline-dev libicu-dev
- checkout
- run:
name: Set up workspace
command: |
mkdir -p "$HERMES_WS_DIR" "$HERMES_WS_DIR/output"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
sudo cp /usr/bin/ninja /usr/bin/ninja.real
# See top comment
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
- run:
name: Build Hermes for Linux
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py --static-link --distribute --cmake-flags="-DCMAKE_CXX_FLAGS=-s"
cd build_release
ninja github-cli-release
- run:
name: Copy artifacts
command: |
cd "$HERMES_WS_DIR"
cp "build_release/github"/hermes-cli-*.tar.gz "output"
- run:
name: Checksum artifacts
command: |
cd "$HERMES_WS_DIR/output"
for file in *
do
sha256sum "$file" > "$file.sha256"
done
- store_artifacts:
path: /tmp/hermes/output/
- persist_to_workspace:
root: /tmp/hermes/output/
paths:
- .
test-linux:
# execution-time-limit.js and sampling-profiler.js segfault in statically
# linked release mode, so this job is just a duplicate of the Linux job
# that builds in dynamically linked debug mode
docker:
- image: debian:stretch
environment:
- HERMES_WS_DIR: /tmp/hermes
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
steps:
- run:
name: Install dependencies
command: |
apt-get update
apt-get install -y \
sudo git openssh-client cmake ninja-build python \
build-essential libreadline-dev libicu-dev zip python3
- checkout
- run:
name: Set up workspace
command: |
mkdir -p "$HERMES_WS_DIR"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
sudo cp /usr/bin/ninja /usr/bin/ninja.real
# See top comment
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
- run:
name: Run Hermes regression tests
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py
cd build
ninja
ninja check-hermes
test-apple-runtime:
<<: *apple_defaults
steps:
- checkout
- restore_cache:
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Install dependencies
command: |
brew install cmake ninja
- run:
name: Build the test application
command: |
pod install
working_directory: test/ApplePlatformsIntegrationTestApp
- run:
name: Test MacOS application
command: |
xcodebuild test \
-workspace ApplePlatformsIntegrationTests.xcworkspace \
-configuration Debug \
-destination 'platform=macOS' \
-scheme ApplePlatformsIntegrationMacTests
working_directory: test/ApplePlatformsIntegrationTestApp
- run:
name: Test iPhone application
command: |
xcodebuild test \
-workspace ApplePlatformsIntegrationTests.xcworkspace \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 11' \
-scheme ApplePlatformsIntegrationMobileTests
working_directory: test/ApplePlatformsIntegrationTestApp
build-apple-runtime:
<<: *apple_defaults
steps:
- checkout
# TODO: Use a better cache key to avoid rebuilding whole framework
# when it is not necessary
- restore_cache:
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Set up workspace
command: mkdir -p /tmp/hermes/output
- run:
name: Install dependencies
command: |
brew install cmake ninja
sudo gem install cocoapods
- run:
name: Build the iOS frameworks
command: ./utils/build-ios-framework.sh
- run:
name: Build the Mac frameworks
command: ./utils/build-mac-framework.sh
- save_cache:
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/hermes/build_iphoneos
- ~/hermes/build_catalyst
- ~/hermes/build_iphonesimulator
- ~/hermes/build_macosx
- ~/hermes/destroot
package-apple-runtime:
<<: *apple_defaults
steps:
- checkout
- restore_cache:
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Set up workspace
command: mkdir -p /tmp/hermes/output
- run:
name: Install dependencies
command: |
brew install cmake ninja
sudo gem install cocoapods
- run:
name: Package the framework
command: |
. ./utils/build-apple-framework.sh
mkdir -p /tmp/cocoapods-package-root/destroot
cp -R ./destroot /tmp/cocoapods-package-root
cp hermes-engine.podspec LICENSE /tmp/cocoapods-package-root
tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
- run:
name: Package the CLI
command: |
. ./utils/build-apple-framework.sh
mkdir -p /tmp/hermes-cli-root
cp -R ./destroot/bin/* /tmp/hermes-cli-root
tar -C /tmp/hermes-cli-root/ -czvf /tmp/hermes/output/hermes-cli-darwin-v$(get_release_version).tar.gz .
- run:
name: Checksum artifacts
command: |
cd /tmp/hermes/output
for file in *
do
shasum -a 256 "$file" > "$file.sha256"
done
- store_artifacts:
path: /tmp/hermes/output/
- persist_to_workspace:
root: /tmp/hermes/output/
paths:
- .
test-macos:
# CheckedMalloc.Death fails in release mode, so build a debug version
# TODO: Switch to `release` and reuse `build_macosx` from previous job
<<: *apple_defaults
steps:
- checkout
- run:
name: Install dependencies
command: |
brew install cmake ninja
- run:
name: Set up workspace
command: |
mkdir -p "$HERMES_WS_DIR"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
- run:
name: Run MacOS regression tests in debug mode
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py
cmake --build ./build
cmake --build ./build --target check-hermes
windows:
executor:
name: win/default
shell: powershell.exe
environment:
- HERMES_WS_DIR: 'C:\tmp\hermes'
- ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
- MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
- CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- checkout
- run:
name: Set up workspace
command: |
New-Item -ItemType Directory $Env:HERMES_WS_DIR
New-Item -ItemType Directory $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory $Env:HERMES_WS_DIR\output
New-Item -ItemType Directory $Env:HERMES_WS_DIR\deps
New-Item -ItemType SymbolicLink -Target . -Path $Env:HERMES_WS_DIR -Name hermes
- run:
name: Download ICU
command: |
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
- run:
name: Install dependencies
command: |
choco install --no-progress cmake --version 3.14.7
if (-not $?) { throw "Failed to install CMake" }
choco install --no-progress python3
if (-not $?) { throw "Failed to install Python" }
- run:
name: Assemble Windows runtime dependencies
command: |
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
- run:
name: Build Hermes for Windows
command: |
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cd $Env:HERMES_WS_DIR
hermes\utils\build\configure.py --build-system='Visual Studio 16 2019' --cmake-flags="-DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF -DHERMES_GITHUB_RESOURCE_DIR=$Env:HERMES_WS_DIR\deps" --distribute
if (-not $?) { throw "Failed to configure Hermes" }
cd build_release
cmake --build . --target github-cli-release --config Release
if (-not $?) { throw "Failed to build Hermes" }
- run:
name: Copy artifacts
command: |
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\github\hermes-cli-*.tar.gz" -Destination "output"
- run:
name: Checksum artifacts
command: |
cd $Env:HERMES_WS_DIR\output
foreach($file in Get-ChildItem) {
$hash = Get-FileHash -Path $file -Algorithm SHA256
Write-Output ($hash.Hash + " " + $file.Name) |
Out-File -Encoding ASCII -FilePath ($file.Name +".sha256")
}
- store_artifacts:
path: c:\tmp\hermes\output
- persist_to_workspace:
root: c:\tmp\hermes\output
paths:
- .
npm:
docker:
- image: cimg/node:lts
environment:
- YARN: yarnpkg
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
steps:
- run:
name: Print versions
command: |
node --version
yarn --version
- run:
name: Install certificates required to attach workspace
command: |
sudo apt-get update
sudo apt-get install -y ca-certificates
- attach_workspace:
at: /tmp/hermes/input
- run:
name: Install dependencies and set up
command: |
mkdir -p /tmp/hermes/output
- checkout
- run:
name: Build NPM
command: |
cd npm
cp /tmp/hermes/input/* .
$YARN install
$YARN unpack-builds
$YARN create-npms
- run:
name: Copy artifacts
command: |
cd npm
cp *.tgz /tmp/hermes/output
# Also copy the other packages for the sole purpose of not having
# to visit multiple jobs pages to download all release artifacts
cp /tmp/hermes/input/*.tar.gz /tmp/hermes/output
- run:
name: Checksum artifacts
command: |
cd /tmp/hermes/output
for file in *
do
sha256sum "$file" > "$file.sha256"
done
- store_artifacts:
path: /tmp/hermes/output
- persist_to_workspace:
root: /tmp/hermes/output
paths:
- .
# test to build with emscripten, not run
test-emscripten:
docker:
# emcc requires Python 3.7+
- image: debian:buster
environment:
- HERMES_WS_DIR: /tmp/hermes
- EMSDK: /tmp/emsdk
- TERM: dumb
- DEBIAN_FRONTEND: noninteractive
steps:
- run:
name: Install dependencies
command: |
apt-get update
apt-get install -y \
sudo git openssh-client cmake ninja-build python \
build-essential libreadline-dev libicu-dev zip python3 \
curl
- run:
name: Setup Emscripten
command: |
set -x
EMSDK_VERSION=2.0.9
curl -sfLO "https://github.com/emscripten-core/emsdk/archive/$EMSDK_VERSION.tar.gz"
tar -xf "$EMSDK_VERSION.tar.gz"
mv "emsdk-$EMSDK_VERSION" "$EMSDK"
rm "$EMSDK_VERSION.tar.gz"
"$EMSDK/emsdk" install latest
"$EMSDK/emsdk" activate latest
- checkout
- run:
name: Set up workspace
command: |
mkdir -p "$HERMES_WS_DIR"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
sudo cp /usr/bin/ninja /usr/bin/ninja.real
# See top comment
printf '%s\n' '#!/bin/sh' 'ninja.real -j4 "$@" || ninja.real -j1 "$@"' | sudo tee /usr/bin/ninja
- run:
name: Build Hermes Compiler
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py ./build_host_hermesc
# Build the Hermes compiler so that the cross compiler build can
# access it to build the VM
cmake --build ./build_host_hermesc --target hermesc
- run:
name: Build Hermes with Emscripten
command: |
set -x
cd "$HERMES_WS_DIR"
source "$EMSDK/emsdk_env.sh"
"$EMSDK"/upstream/emscripten/emcc --version
cmake ./hermes \
-Bembuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-s NODERAWFS=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s LLD_REPORT_UNDEFINED=1" \
-DCMAKE_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
-DIMPORT_HERMESC="$PWD/build_host_hermesc/ImportHermesc.cmake"
cmake --build ./embuild --target hermes
cmake --build ./embuild --target hermesc
cmake --build ./embuild --target emhermesc
EMHERMESC="$PWD/embuild/bin/emhermesc.js" node ./hermes/tools/emhermesc/test.js
test-e2e:
# For now we run E2E tests on MacOS as running an Android emulator on Linux is
# not supported with Circle CI:
# https://support.circleci.com/hc/en-us/articles/360000028928-Testing-with-Android-emulator-on-CircleCI-2-0
# Windows is another option, but I came across a convenient Mac OS example first:
# https://gist.github.com/DoguD/58b4b86a5d892130af84074078581b87
macos:
xcode: 12.4.0
environment:
- TERM: dumb
# Homebrew currently breaks while updating:
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
- HOMEBREW_NO_AUTO_UPDATE: 1
- JVM_OPTS: -Xmx3200m
- ANDROID_HOME: /usr/local/share/android-sdk
- ANDROID_SDK_HOME: /usr/local/share/android-sdk
- ANDROID_SDK_ROOT: /usr/local/share/android-sdk
- ANDROID_NDK_HOME: /usr/local/share/android-ndk
- QEMU_AUDIO_DRV: none
- JAVA_HOME: $(/usr/libexec/java_home)
steps:
- run:
name: Setup dependencies
command: |
mkdir -p /tmp/hermes/output
# Node some version greater than 11 is needed by one of the app dependencies
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
nvm install 14
nvm use 14
# Reinstall the latest version of Yarn.
npm install --global yarn
brew tap homebrew/cask
brew install --cask android-sdk
brew install --cask android-ndk
echo 'export PATH="/usr/local/share/android-sdk/platform-tools:/usr/local/share/android-sdk/tools/bin:$PATH"' >> $BASH_ENV
# At some point, adb ended up in platform-tools/platform-tools. Work around that.
echo 'export PATH="/usr/local/share/android-sdk/platform-tools/platform-tools:$PATH"' >> $BASH_ENV
- run:
name: Print versions
command: |
node --version
yarn --version
echo $(/usr/libexec/java_home)
- run:
name: Install emulator dependencies
command: (yes | sdkmanager "platform-tools" "platforms;android-26" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;26.0.0" "system-images;android-26;google_apis;x86" "emulator" --verbose) || true
- run:
name: Create emulator definition
command: |
avdmanager create avd -n Pixel_2_API_26 -k "system-images;android-26;google_apis;x86" -g google_apis -d "Nexus 5"
- run:
name: Run emulator in background
command: /usr/local/share/android-sdk/emulator/emulator @Pixel_2_API_26 -memory 2048 -noaudio
background: true
- checkout
- attach_workspace:
at: /tmp/hermes/input
- run:
name: Run E2E test with main Hermes and Release React Native
command: |
cd test/circleci-e2e
./run.sh --hermes-npm-package /tmp/hermes/input/hermes-engine-v*.tgz
# The react-native setup tool takes AGES "Installing CocoaPods dependencies"
no_output_timeout: 45m
- store_artifacts:
path: /tmp/hermes/output/
test-e2e-intl:
# This is mostly based on the last test-e2e job, hence the comments there holds.
macos:
xcode: 12.4.0
environment:
- TERM: dumb
# Homebrew currently breaks while updating:
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
- HOMEBREW_NO_AUTO_UPDATE: 1
- JVM_OPTS: -Xmx3200m
- ANDROID_HOME: /usr/local/share/android-sdk
- ANDROID_SDK_HOME: /usr/local/share/android-sdk
- ANDROID_SDK_ROOT: /usr/local/share/android-sdk
- QEMU_AUDIO_DRV: none
- JAVA_HOME: $(/usr/libexec/java_home)
- HERMES_WS_DIR: /tmp/hermes
steps:
- checkout
- attach_workspace:
at: /tmp/hermes/input
- run:
name: Setup dependencies
command: |
echo $(/usr/libexec/java_home)
brew tap homebrew/cask
brew install --cask android-sdk
(yes | sdkmanager "platform-tools" "platforms;android-26" --verbose) || true
echo 'export PATH="/usr/local/share/android-sdk/platform-tools:/usr/local/share/android-sdk/tools/bin:$PATH"' >> ~/.bash_profile
- run:
name: Install emulator dependencies
command: (yes | sdkmanager "extras;intel;Hardware_Accelerated_Execution_Manager" "system-images;android-26;google_apis;x86" "emulator" --verbose) || true
- run:
name: Create emulator definition
command: |
avdmanager create avd -n Pixel_2_API_26 -k "system-images;android-26;google_apis;x86" -g google_apis -d "Nexus 5"
- run:
name: Run emulator in background
command: /usr/local/share/android-sdk/emulator/emulator @Pixel_2_API_26 -memory 2048 -noaudio
background: true
- run:
name: Set up build dependencies
command: |
(yes | sdkmanager "ndk;21.0.6113669" "cmake;3.10.2.4988404" --verbose) || true
echo 'export PATH="/usr/local/share/android-sdk/cmake/3.10.2.4988404/bin:$PATH"' >> ~/.bash_profile
- run:
name: Set up workspace
command: |
mkdir -p "$HERMES_WS_DIR" "$HERMES_WS_DIR/output"
ln -sf "$PWD" "$HERMES_WS_DIR/hermes"
- run:
name: Build Hermes Compiler
command: |
cd "$HERMES_WS_DIR"
hermes/utils/build/configure.py ./build
# Build the Hermes compiler so that the cross compiler build can
# access it to build the VM
cmake --build ./build --target hermesc
- run:
name: Build Hermes for Android and Run tests
command: |
# Ensure the emulator is ready.
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
export ANDROID_SDK="$ANDROID_HOME"
export ANDROID_NDK="$ANDROID_HOME/ndk/21.0.6113669"
cd "$HERMES_WS_DIR/hermes/android"
# We need to build only x86 for running the tests. This saves a lot of computing resources.
echo 'abis=x86' >> gradle.properties
adb logcat -c || true
./gradlew :intltest:preparetest262 && ./gradlew :intltest:connectedAndroidTest
adb logcat -d > /tmp/hermes/output/adblog.txt
# Move report to output dir
mv /tmp/hermes/build_android /tmp/hermes/output/build_android
- store_artifacts:
path: /tmp/hermes/output/