Skip to content

Commit

Permalink
Separate windows workflow build and run parts
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Feb 19, 2023
1 parent f189f66 commit 0957c38
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
6 changes: 6 additions & 0 deletions ci/actions/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions ci/actions/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 1 addition & 7 deletions ci/actions/windows/run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
14 changes: 14 additions & 0 deletions ci/actions/windows/run.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0957c38

Please sign in to comment.