Skip to content

Commit d66b6f1

Browse files
committed
CircleCI Windows config and install_deps.ps1 script.
1 parent 860226e commit d66b6f1

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

.circleci/build_win.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cd "$PSScriptRoot\.."
2+
mkdir build
3+
cd build
4+
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*)
5+
..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" ..
6+
msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal
7+
..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release

.circleci/config.yml

+37
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ parameters:
2727
type: string
2828
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:23dad3b34deae8107c8551804ef299f6a89c23ed506e8118fac151e2bdc9018c"
2929

30+
orbs:
31+
win: circleci/windows@2.2.0
32+
3033
defaults:
3134

3235
# --------------------------------------------------------------------------
@@ -64,6 +67,11 @@ defaults:
6467
path: build/solc/solc
6568
destination: solc
6669

70+
# windows binary archive
71+
- artifact_solc_windows: &artifact_solc_windows
72+
path: upload/solidity-windows.zip
73+
destination: solidity-windows.zip
74+
6775
# compiled tool executable target
6876
- artifacts_tools: &artifacts_tools
6977
path: build/tools/solidity-upgrade
@@ -876,6 +884,32 @@ jobs:
876884
- run: *gitter_notify_failure
877885
- run: *gitter_notify_success
878886

887+
b_win:
888+
executor:
889+
name: win/default
890+
shell: powershell.exe
891+
steps:
892+
- checkout
893+
- restore_cache:
894+
keys:
895+
- dependencies-win-{{ checksum "scripts/install_deps.ps1" }}
896+
- run:
897+
name: "Installing dependencies"
898+
command: if ( -not (Test-Path .\deps\boost) ) { .\scripts\install_deps.ps1 }
899+
- save_cache:
900+
key: dependencies-win-{{ checksum "scripts/install_deps.ps1" }}
901+
paths:
902+
- .\deps\boost
903+
- .\deps\cmake
904+
- run:
905+
name: "Building solidity"
906+
command: .circleci/build_win.ps1
907+
- run:
908+
name: "Package solidity"
909+
command: Compress-Archive -Path .\upload\bin\* -DestinationPath .\upload\solidity-windows.zip
910+
- store_artifacts: *artifact_solc_windows
911+
- persist_to_workspace: *artifacts_build_dir
912+
879913
workflows:
880914
version: 2
881915

@@ -927,6 +961,9 @@ workflows:
927961
- t_ems_compile_ext_gnosis: *workflow_emscripten
928962
- t_ems_compile_ext_zeppelin: *workflow_emscripten
929963

964+
# Windows build and tests
965+
- b_win: *workflow_trigger_on_tags
966+
930967
nightly:
931968

932969
triggers:

scripts/install_deps.ps1

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Needed for Invoke-WebRequest to work via CI.
2+
$progressPreference = "silentlyContinue"
3+
4+
New-Item -ItemType Directory -Force -Path "$PSScriptRoot\..\deps"
5+
6+
Invoke-WebRequest -URI "https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-win64-x64.zip" -OutFile cmake.zip
7+
tar -xf cmake.zip
8+
mv cmake-3.18.2-win64-x64 "$PSScriptRoot\..\deps\cmake"
9+
10+
Invoke-WebRequest -URI "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.zip" -OutFile boost.zip
11+
tar -xf boost.zip
12+
cd boost_1_74_0
13+
.\bootstrap.bat
14+
.\b2 -j4 -d0 link=static runtime-link=static variant=release threading=multi address-model=64 --with-filesystem --with-system --with-program_options --with-test --prefix="$PSScriptRoot\..\deps\boost" install
15+
cd ..

0 commit comments

Comments
 (0)