From 0957c38f56108417189b48decdc5c2d0a6946736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 30 Jan 2023 22:10:00 +0100 Subject: [PATCH] Separate windows workflow build and run parts --- .github/workflows/unit_tests.yml | 5 ++++- ci/actions/windows/build.bat | 6 ++++++ ci/actions/windows/build.ps1 | 6 +----- ci/actions/windows/run.bat | 8 +------- ci/actions/windows/run.ps1 | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 ci/actions/windows/run.ps1 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 538c896e7..a238afda2 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -99,7 +99,10 @@ jobs: - name: Fetch Deps run: ci/actions/windows/install_deps.ps1 - - name: Build & Run Tests + - name: Build Tests run: ci/actions/windows/build.ps1 + + - name: Run Tests [TEST_USE_ROCKSDB=${{ env.TEST_USE_ROCKSDB }}] + run: ci/actions/windows/run.ps1 env: DEADLINE_SCALE_FACTOR: ${{ env.TEST_USE_ROCKSDB == 1 && '2' || '1' }} diff --git a/ci/actions/windows/build.bat b/ci/actions/windows/build.bat index 7d3e5bd5d..54729193b 100644 --- a/ci/actions/windows/build.bat +++ b/ci/actions/windows/build.bat @@ -23,6 +23,12 @@ cmake --build . ^ --config %BUILD_TYPE% ^ -- /m:2 set exit_code=%errorlevel% + +echo "Packaging NSIS" +call "%cmake_path%\cpack.exe" -C %BUILD_TYPE% +echo "Packaging ZIP" +call "%cmake_path%\cpack.exe" -G ZIP -C %BUILD_TYPE% + goto exit :exit diff --git a/ci/actions/windows/build.ps1 b/ci/actions/windows/build.ps1 index 6d44ca2f8..86199dc8b 100644 --- a/ci/actions/windows/build.ps1 +++ b/ci/actions/windows/build.ps1 @@ -52,12 +52,8 @@ if (${env:RUN} -eq "artifact") { if (${LastExitCode} -ne 0) { throw "Failed to build ${env:RUN}" } + $env:cmake_path = Split-Path -Path(get-command cmake.exe).Path . "$PSScriptRoot\signing.ps1" -& ..\ci\actions\windows\run.bat -if (${LastExitCode} -ne 0) { - throw "Failed to Pass Test ${env:RUN}" -} - Pop-Location diff --git a/ci/actions/windows/run.bat b/ci/actions/windows/run.bat index 97e2c16c1..c580c9d4d 100644 --- a/ci/actions/windows/run.bat +++ b/ci/actions/windows/run.bat @@ -17,10 +17,4 @@ set rpc_code=%errorlevel% echo Core Test %core_code% echo RPC Test %rpc_code% -exit /B %core_code% - -:artifact -echo "Packaging NSIS" -call "%cmake_path%\cpack.exe" -C %BUILD_TYPE% -echo "Packaging ZIP" -call "%cmake_path%\cpack.exe" -G ZIP -C %BUILD_TYPE% +exit /B %core_code% \ No newline at end of file diff --git a/ci/actions/windows/run.ps1 b/ci/actions/windows/run.ps1 new file mode 100644 index 000000000..8a4f32c86 --- /dev/null +++ b/ci/actions/windows/run.ps1 @@ -0,0 +1,14 @@ +$ErrorActionPreference = "Continue" + +$env:BUILD_TYPE = "Debug" +$env:NETWORK_CFG = "dev" +$env:RUN = "test" + +Push-Location build + +& ..\ci\actions\windows\run.bat +if (${LastExitCode} -ne 0) { + throw "Failed to Pass Test ${env:RUN}" +} + +Pop-Location \ No newline at end of file