-
Notifications
You must be signed in to change notification settings - Fork 648
/
Copy pathconfig.yml
128 lines (115 loc) · 5.27 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
version: 2.1
orbs:
win: circleci/[email protected]
workflows:
version: 2
build:
jobs:
- windows
- test-windows
jobs:
test-windows:
executor:
name: win/default
version: 2023.10.1
environment:
- CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- checkout:
path: hermes
- run:
name: Set up dependencies
command: |
choco install -y --no-progress cmake --version 3.14.7 --installargs 'ADD_CMAKE_TO_PATH=System'
if (-not $?) { throw "Failed to install CMake" }
ln -s (get-command python.exe).Path (get-command python.exe).Path.replace("python.exe", "python3.exe")
- run:
name: Run Hermes regression tests
command: |
$Env:PATH += ";$Env:CMAKE_DIR"
cmake -S hermes -B build -G 'Visual Studio 16 2019'
cmake --build build --target check-hermes -- -m /p:UseMultiToolTask=true -m /p:EnforceProcessCountAcrossBuilds=true
windows:
executor:
name: win/default
version: 2023.10.1
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'
- RELEASE_FLAGS: -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
- TAR_NAME: 'hermes-cli-windows.tar.gz'
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\staging
New-Item -ItemType Directory $Env:HERMES_WS_DIR\output
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 -y --no-progress cmake --version 3.14.7 --installargs 'ADD_CMAKE_TO_PATH=System'
if (-not $?) { throw "Failed to install CMake" }
ln -s (get-command python.exe).Path (get-command python.exe).Path.replace("python.exe", "python3.exe")
- run:
name: Assemble Windows runtime dependencies
command: |
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "staging"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "staging"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "staging"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "staging"
- run:
name: Build Windows CLI
command: |
$Env:PATH += ";$Env:MSBUILD_DIR;$Env:CMAKE_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cd $Env:HERMES_WS_DIR
cmake -S hermes -B build -G 'Visual Studio 16 2019' -Ax64 -DHERMES_ENABLE_DEBUGGER=False $Env:RELEASE_FLAGS
if (-not $?) { throw "Failed to configure Hermes" }
cmake -S hermes -B build_hdb -G 'Visual Studio 16 2019' -Ax64 $Env:RELEASE_FLAGS
if (-not $?) { throw "Failed to configure Hermes" }
cmake --build ./build --config Release -- -m /p:UseMultiToolTask=true -m /p:EnforceProcessCountAcrossBuilds=true
if (-not $?) { throw "Failed to build Hermes" }
cmake --build ./build_hdb --config Release --target hdb -- -m /p:UseMultiToolTask=true -m /p:EnforceProcessCountAcrossBuilds=true
if (-not $?) { throw "Failed to build Hermes" }
- run:
name: Create CLI tarball
command: |
$Env:PATH += ";$Env:CMAKE_DIR"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build\bin\Release\hermes.exe" -Destination "staging"
Copy-Item -Path "build\bin\Release\hvm.exe" -Destination "staging"
Copy-Item -Path "build\bin\Release\hbcdump.exe" -Destination "staging"
Copy-Item -Path "build\bin\Release\hermesc.exe" -Destination "staging"
Copy-Item -Path "build_hdb\bin\Release\hdb.exe" -Destination "staging"
cd staging
cmake -E tar zcf ..\output\$Env:TAR_NAME .
- run:
name: Checksum artifacts
command: |
cd $Env:HERMES_WS_DIR\output
$hash = Get-FileHash -Path $Env:TAR_NAME -Algorithm SHA256
Write-Output ($hash.Hash + " " + $Env:TAR_NAME) |
Out-File -Encoding ASCII -FilePath ($Env:TAR_NAME +".sha256")
- store_artifacts:
path: c:\tmp\hermes\output
- persist_to_workspace:
root: c:\tmp\hermes\output
paths:
- .