Skip to content

Commit 0c85a92

Browse files
authored
poweshell CI cleanups (#1437)
* switch actons powershell->pwsh * cleanup ps1 scripts Invoke-Formatter -ScriptDefinition (Get-Content -Path '.\ci_script_windows.ps1' -Raw) Invoke-ScriptAnalyzer -Path .\ci_script_windows.ps1 [-Settings _] * delete obsolete comment
1 parent 6b9f512 commit 0c85a92

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/windows.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
run: choco install innosetup
107107

108108
- name: Build
109-
shell: powershell
109+
shell: pwsh
110110
run: |
111111
if ([string]::IsNullOrEmpty("${{ matrix.CROSS_COMPILER }}")) {
112112
.\tools\ci_setup_windows.ps1 -qtdir "$Home\Cache\Qt\${{ matrix.QT_VERSION }}\${{ matrix.COMPILER }}" -arch "${{ matrix.ARCH }}" -host_arch "${{ matrix.HOST_ARCH }}" -vcversion "${{ matrix.VCVERSION }}"
@@ -118,7 +118,7 @@ jobs:
118118
$hash["target_arch"] = "${{ matrix.TARGET_ARCH }}"
119119
$hash["compiler"] = "${{ matrix.COMPILER }}"
120120
$hash["cross_compiler"] = "${{ matrix.CROSS_COMPILER }}"
121-
.\tools\ci_windows_cross_compile @hash
121+
.\tools\ci_windows_cross_compile.ps1 @hash
122122
}
123123
124124
- name: Rename
@@ -134,7 +134,6 @@ jobs:
134134
shell: bash
135135
if: matrix.CROSS_COMPILER == ''
136136
run: |
137-
# PATH="${HOME}/Cache/Qt/${{ matrix.QT_VERSION }}/${{ matrix.COMPILER }}/bin:${PATH}"
138137
PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./testo 2>&1
139138
PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./test_encoding_utf8 2>&1
140139
@@ -181,7 +180,7 @@ jobs:
181180
merge-multiple: true
182181

183182
- name: 'Install Artifact'
184-
shell: powershell
183+
shell: pwsh
185184
run: |
186185
$install_path=Join-Path $(Get-Location) bld
187186
.\bld\GPSBabel-*-*-Setup-arm64.exe /SILENT /NORESTART /DIR="${install_path}" /LOG=bld\log.txt

tools/ci_script_windows.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1
88
#
99
# The defaults should be compatible with github action builds.
10-
Param(
10+
param(
1111
$build_dir_name = "bld",
1212
$generator = "Ninja",
1313
$toolset = "",
@@ -40,15 +40,16 @@ New-Item $build_dir -type directory -Force | Out-Null
4040
Set-Location $build_dir
4141
$hashargs = "-G", $generator
4242
if ( $toolset ) {
43-
$hashargs += "-T", $toolset
43+
$hashargs += "-T", $toolset
4444
}
4545
if ( $generator -like "Visual Studio*") {
46-
$hashargs += "-A", $platform
47-
} else {
48-
$hashargs += "-DCMAKE_BUILD_TYPE:STRING=Release"
46+
$hashargs += "-A", $platform
47+
}
48+
else {
49+
$hashargs += "-DCMAKE_BUILD_TYPE:STRING=Release"
4950
}
5051
$hashargs += "-DCMAKE_PREFIX_PATH:PATH=$CMAKE_PREFIX_PATH"
51-
Write-Output cmake $hashargs $src_dir
52+
Write-Output "cmake $hashargs $src_dir"
5253
cmake $hashargs $src_dir
5354
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
5455
switch -wildcard ($generator) {
@@ -58,6 +59,6 @@ switch -wildcard ($generator) {
5859
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
5960
switch -wildcard ($generator) {
6061
"Visual Studio*" { cmake --build $build_dir --config Release --target package_app }
61-
default { cmake --build $build_dir --target package_app}
62+
default { cmake --build $build_dir --target package_app }
6263
}
6364
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }

tools/ci_setup_windows.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# see https://github.com/actions/virtual-environments/issues/294
77
# and https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
88

9-
Param(
9+
param(
1010
[string] $qtdir = "C:\Qt\6.5.3\msvc2019_64",
1111
[ValidateSet("x86", "amd64")][string] $arch = "amd64",
1212
[ValidateSet("x86", "amd64")][string] $host_arch = "amd64",

tools/ci_windows_cross_compile.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Param(
1+
param(
22
$build_dir_name = "bld",
33
$qt_root_dir = "C:/Qt/6.8.3",
44
$host_arch = "amd64",

0 commit comments

Comments
 (0)