mirror of
https://github.com/Ed94/refactor.git
synced 2024-12-22 06:54:44 -08:00
Made a separate build script for CI.
This commit is contained in:
parent
018286be6f
commit
78cdfcd7b3
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -81,4 +81,4 @@ jobs:
|
|||||||
if (-not [string]::IsNullOrEmpty($type)) { $args += $type }
|
if (-not [string]::IsNullOrEmpty($type)) { $args += $type }
|
||||||
if (-not [string]::IsNullOrEmpty($test)) { $args += $test }
|
if (-not [string]::IsNullOrEmpty($test)) { $args += $test }
|
||||||
|
|
||||||
& .\scripts\build.ps1 debug test
|
& .\scripts\build.ci.ps1 debug test
|
||||||
|
81
scripts/build.ci.ps1
Normal file
81
scripts/build.ci.ps1
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
[string] $type = $null
|
||||||
|
[string] $test = $false
|
||||||
|
|
||||||
|
foreach ( $arg in $args )
|
||||||
|
{
|
||||||
|
if ( $arg -eq "test" )
|
||||||
|
{
|
||||||
|
$test = $true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$type = $arg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Regular Build
|
||||||
|
|
||||||
|
write-host "Building project`n"
|
||||||
|
|
||||||
|
$path_root = git rev-parse --show-toplevel
|
||||||
|
$path_build = Join-Path $path_root build
|
||||||
|
$path_scripts = Join-Path $path_root scripts
|
||||||
|
|
||||||
|
|
||||||
|
if ( -not( Test-Path $path_build ) )
|
||||||
|
{
|
||||||
|
$args_meson = @()
|
||||||
|
$args_meson += "setup"
|
||||||
|
$args_meson += $path_build
|
||||||
|
|
||||||
|
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_scripts
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $type )
|
||||||
|
{
|
||||||
|
$args_meson = @()
|
||||||
|
$args_meson += "configure"
|
||||||
|
$args_meson += $path_build
|
||||||
|
$args_meson += "--buildtype $($type)"
|
||||||
|
|
||||||
|
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_scripts
|
||||||
|
}
|
||||||
|
|
||||||
|
$args_ninja = @()
|
||||||
|
$args_ninja += "-C"
|
||||||
|
$args_ninja += $path_build
|
||||||
|
|
||||||
|
Start-Process ninja $args_ninja -Wait -NoNewWindow -WorkingDirectory $path_root
|
||||||
|
#endregion Regular Build
|
||||||
|
|
||||||
|
|
||||||
|
if ( $test -eq $true )
|
||||||
|
{
|
||||||
|
#region Test Build
|
||||||
|
write-host "`n`nBuilding Test`n"
|
||||||
|
|
||||||
|
# Refactor thirdparty libraries
|
||||||
|
& (Join-Path $PSScriptRoot 'refactor_and_format.ps1')
|
||||||
|
|
||||||
|
$path_test = Join-Path $path_root test
|
||||||
|
$path_test_build = Join-Path $path_test build
|
||||||
|
|
||||||
|
if ( -not( Test-Path $path_test_build ) )
|
||||||
|
{
|
||||||
|
$args_meson = @()
|
||||||
|
$args_meson += "setup"
|
||||||
|
$args_meson += $path_test_build
|
||||||
|
|
||||||
|
Start-Process meson $args_meson -NoNewWindow -Wait -WorkingDirectory $path_test
|
||||||
|
}
|
||||||
|
|
||||||
|
$args_ninja = @()
|
||||||
|
$args_ninja += "-C"
|
||||||
|
$args_ninja += $path_test_build
|
||||||
|
|
||||||
|
write-host $args_ninja
|
||||||
|
|
||||||
|
Start-Process ninja $args_ninja -Wait -NoNewWindow -WorkingDirectory $path_root
|
||||||
|
#endregion Test Build
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
if ($Host.UI.RawUI -and $Host.UI.RawUI.CursorPosition)
|
if ( NOT_HEADLESSS )
|
||||||
{
|
{
|
||||||
cls
|
cls
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user