From 0f799fec38e6b78602673b84e1554ea0c3c01627 Mon Sep 17 00:00:00 2001 From: oberrich Date: Fri, 10 Jan 2025 10:52:18 +0100 Subject: [PATCH] chore: improve ci powershell --- .github/workflows/rust.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 10adf78..e78f3d8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,21 +54,21 @@ jobs: $deps = @( @{ Name = 'Chocolatey'; Url = 'https://chocolatey.org/install.ps1'; Hash = $null; - Action = { & './install.ps1' }}, + Action = '.\install.ps1' }, @{ Name = 'Visual Studio 2022 Build Tools (aarch64)'; Hash = $null; Url = $null; - Action = { choco install visualstudio2022buildtools -y --no-progress --silent --package-parameters '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621' }}, + Action = 'choco install visualstudio2022buildtools -y --no-progress --silent --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621"' }, @{ Name = 'LLVM 19.1.5'; - Url = '${{ github.workspace }}/LLVM-19.1.5-woa64.exe'; - Hash = '63D479C19C3908F8C973331EDC9B576485EAB6AB0809F58C79DF5D209FDD8F96'; - Action = { Start-Process -FilePath "LLVM-19.1.5-woa64.exe" -ArgumentList '/S' -NoNewWindow -Wait }}, + Url = '${{ github.workspace }}/LLVM-19.1.5-woa64.exe'; + Hash = '63D479C19C3908F8C973331EDC9B576485EAB6AB0809F58C79DF5D209FDD8F96'; + Action = '.\LLVM-19.1.5-woa64.exe /S' }, @{ Name = 'Rust (nightly, aarch64)'; - Url = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe'; - Hash = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe.sha256'; - Action = { & './rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y }}, + Url = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe'; + Hash = 'https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe.sha256'; + Action = '.\rustup-init.exe --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y' }, @{ Name = 'Git 2.48.0-rc1'; - Url = '${{ github.workspace }}/Git-2.48.0-rc2-arm64.exe'; - Hash = '712739bb49832d571732e3e74b111d7cb4a63cd622ef3e87d01efe35046d9a4f'; - Action = { & './Git-2.48.0-rc2-arm64.exe' /VERYSILENT }} + Url = '${{ github.workspace }}/Git-2.48.0-rc2-arm64.exe'; + Hash = '712739bb49832d571732e3e74b111d7cb4a63cd622ef3e87d01efe35046d9a4f'; + Action = '.\Git-2.48.0-rc2-arm64.exe /VERYSILENT' } ) $deps | ForEach-Object { @@ -81,7 +81,7 @@ jobs: Log "Using local files from '$($dep.Url)'..." $install_file = $dep.Url } - + if ($dep.Hash -ne $null) { $expected_hash = if ($dep.Hash -like "*.sha256") { $hash_file = Join-Path '${{ github.workspace }}' (Split-Path $dep.Hash -Leaf) @@ -98,11 +98,12 @@ jobs: Log "Hash mismatch for $($dep.Name). Expected: $expected_hash, Got: $downloaded_hash" -Level "ERROR" } } else { - Log "No hash specified, skipping verification." + Log "No hash specified, skipping verification." } Log "Installing $($dep.Name)..." - & $dep.Action + # Execute the command directly + Start-Process -FilePath cmd.exe -ArgumentList "/c $($dep.Action)" -NoNewWindow -Wait Log "$($dep.Name) installation completed." }