From 23fa0a538702e3329a004da3b53fecff4ebeb185 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Wed, 16 Sep 2020 16:24:11 +0200 Subject: [PATCH 1/3] Test run for CircleCI windows builds. --- .circleci/config.yml | 30 ++++++++++++++++++++++++++++++ .circleci/soltest.ps1 | 7 +++++++ scripts/install_evmone.ps1 | 7 +++++++ 3 files changed, 44 insertions(+) create mode 100755 .circleci/soltest.ps1 create mode 100644 scripts/install_evmone.ps1 diff --git a/.circleci/config.yml b/.circleci/config.yml index 55204b8e5..1408babb3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -250,6 +250,16 @@ defaults: requires: - b_ubu_ossfuzz + - workflow_win: &workflow_win + <<: *workflow_trigger_on_tags + requires: + - b_win + + - workflow_win_release: &workflow_win_release + <<: *workflow_trigger_on_tags + requires: + - b_win_release + # -------------------------------------------------------------------------- # Notification Templates - gitter_notify_failure: &gitter_notify_failure @@ -911,6 +921,24 @@ jobs: environment: FORCE_RELEASE: ON + t_win: &t_win + executor: + name: win/default + shell: powershell.exe + steps: + - checkout + - attach_workspace: + at: build + - run: + name: "Install evmone" + command: scripts/install_evmone.ps1 + - run: + name: "Run soltest" + command: .circleci/soltest.ps1 + - store_artifacts: *artifacts_test_results + + t_win_release: + <<: *t_win workflows: version: 2 @@ -966,6 +994,8 @@ workflows: # Windows build and tests - b_win: *workflow_trigger_on_tags - b_win_release: *workflow_trigger_on_tags + - t_win: *workflow_win + - t_win_release: *workflow_win_release nightly: diff --git a/.circleci/soltest.ps1 b/.circleci/soltest.ps1 new file mode 100755 index 000000000..ab5cb4ba7 --- /dev/null +++ b/.circleci/soltest.ps1 @@ -0,0 +1,7 @@ +cd "$PSScriptRoot\.." + +.\build\solc\Release\solc.exe --version + +mkdir test_results +.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml -- --no-smt +.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml -- --optimize --no-smt diff --git a/scripts/install_evmone.ps1 b/scripts/install_evmone.ps1 new file mode 100644 index 000000000..3b728d923 --- /dev/null +++ b/scripts/install_evmone.ps1 @@ -0,0 +1,7 @@ +# Needed for Invoke-WebRequest to work via CI. +$progressPreference = "silentlyContinue" + +Invoke-WebRequest -URI "https://github.com/ethereum/evmone/releases/download/v0.5.0/evmone-0.5.0-windows-amd64.zip" -OutFile "evmone.zip" +tar -xf evmone.zip "bin/evmone.dll" +mkdir deps +mv bin/evmone.dll deps From a1de862135ab1706ca6065162e1cdbdfd5627820 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 17 Sep 2020 13:08:14 +0200 Subject: [PATCH 2/3] Set ErrorActionPreference on all powershell scripts and add explicit error checks. --- .circleci/build_win.ps1 | 5 +++++ .circleci/soltest.ps1 | 5 +++++ scripts/install_deps.ps1 | 3 +++ scripts/install_evmone.ps1 | 2 ++ 4 files changed, 15 insertions(+) diff --git a/.circleci/build_win.ps1 b/.circleci/build_win.ps1 index 4df23de42..66f9be33a 100644 --- a/.circleci/build_win.ps1 +++ b/.circleci/build_win.ps1 @@ -1,3 +1,5 @@ +$ErrorActionPreference = "Stop" + cd "$PSScriptRoot\.." if ("$Env:FORCE_RELEASE") { @@ -9,5 +11,8 @@ mkdir build cd build $boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*) ..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" .. +if ( -not $? ) { throw "CMake configure failed." } msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal +if ( -not $? ) { throw "Build failed." } ..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release +if ( -not $? ) { throw "Install target failed." } diff --git a/.circleci/soltest.ps1 b/.circleci/soltest.ps1 index ab5cb4ba7..6b67adb13 100755 --- a/.circleci/soltest.ps1 +++ b/.circleci/soltest.ps1 @@ -1,7 +1,12 @@ +$ErrorActionPreference = "Stop" + cd "$PSScriptRoot\.." .\build\solc\Release\solc.exe --version +if ( -not $? ) { throw "Cannot execute solc --version." } mkdir test_results .\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml -- --no-smt +if ( -not $? ) { throw "Unoptimized soltest run failed." } .\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml -- --optimize --no-smt +if ( -not $? ) { throw "Optimized soltest run failed." } \ No newline at end of file diff --git a/scripts/install_deps.ps1 b/scripts/install_deps.ps1 index bcf10eed9..c1301c74e 100644 --- a/scripts/install_deps.ps1 +++ b/scripts/install_deps.ps1 @@ -1,3 +1,5 @@ +$ErrorActionPreference = "Stop" + # Needed for Invoke-WebRequest to work via CI. $progressPreference = "silentlyContinue" @@ -12,4 +14,5 @@ tar -xf boost.zip cd boost_1_74_0 .\bootstrap.bat .\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 +if ( -not $? ) { throw "Error building boost." } cd .. diff --git a/scripts/install_evmone.ps1 b/scripts/install_evmone.ps1 index 3b728d923..ba69dab34 100644 --- a/scripts/install_evmone.ps1 +++ b/scripts/install_evmone.ps1 @@ -1,3 +1,5 @@ +$ErrorActionPreference = "Stop" + # Needed for Invoke-WebRequest to work via CI. $progressPreference = "silentlyContinue" From e716c9e2b9adbba48abf655ffbcc7035371486dd Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 17 Sep 2020 14:46:24 +0200 Subject: [PATCH 3/3] Run solc.exe after build run just to make sure no error was missed. --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1408babb3..daefe4472 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -913,6 +913,9 @@ jobs: - run: name: "Building solidity" command: .circleci/build_win.ps1 + - run: + name: "Run solc.exe to make sure build was successful." + command: .\build\solc\Release\solc.exe --version - store_artifacts: *artifact_solc_windows - persist_to_workspace: *artifacts_build_dir