From 139a74f63345a792ad3748db3ccf80093754afa2 Mon Sep 17 00:00:00 2001 From: oberrich Date: Fri, 10 Jan 2025 06:04:40 +0100 Subject: [PATCH] chore: use nushell in ci --- .github/workflows/rust.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8193a3c..419e82b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -51,13 +51,14 @@ jobs: - name: Use nushell if: matrix.os == 'windows-11-preview_aarch64' run: | - function log { + function Log { param( [Parameter(Mandatory=$true)] [string]$Message, [string]$Level = "INFO" ) Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [$Level] - $Message" } + function Install { param( [Parameter(Mandatory=$true)] [string]$Name, @@ -65,21 +66,28 @@ jobs: [string]$Level = "INFO" ) - log -Level $Level -Message "Installing $SoftwareName..." + Log -Level $Level -Message "Installing $SoftwareName..." &$Action - log -Level $Level -Message "$SoftwareName installation completed." + Log -Level $Level -Message "$SoftwareName installation completed." } - Invoke-WebRequest -Uri "https://win.rustup.rs/aarch64" -OutFile '${{github.workspace}}\rustup-init.exe' - $installs = @( - @{ Name = "LLVM 19.1.5 (aarch64)"; Action = { & "$env:GITHUB_WORKSPACE\LLVM-19.1.5-woa64.exe" /S } }, - @{ Name = "Git 2.48.0-rc1 (aarch64)"; Action = { & "$env:GITHUB_WORKSPACE\Git-2.48.0-rc1-arm64.exe" /VERYSILENT } }, - @{ Name = "Visual Studio 2022 Build Tools (aarch64)"; Action = { choco install visualstudio2022buildtools -y --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621" } }, - @{ Name = "Rust (nightly, aarch64)"; Action = { & '${{github.workspace}}\rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y } } + @{ Name = "LLVM 19.1.5 (aarch64)"; + Action = { & "$env:GITHUB_WORKSPACE\LLVM-19.1.5-woa64.exe" /S } }, + @{ Name = "Git 2.48.0-rc1 (aarch64)"; + Action = { & "$env:GITHUB_WORKSPACE\Git-2.48.0-rc1-arm64.exe" /VERYSILENT } }, + @{ Name = "Visual Studio 2022 Build Tools (aarch64)"; + Action = { choco install visualstudio2022buildtools -y --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621" } }, + @{ Name = "Rust (nightly, aarch64)"; + Action = { + Invoke-WebRequest -Uri "https://win.rustup.rs/aarch64" -OutFile '${{github.workspace}}\rustup-init.exe' + & '${{github.workspace}}\rustup-init.exe' --default-host aarch64-pc-windows-msvc --default-toolchain nightly -y + } + } ) + $installs | ForEach-Object { - Install-Name $_.Name -Action $_.Action + Install -Name $_.Name -Action $_.Action } $exports = @( @@ -91,7 +99,7 @@ jobs: $exports | ForEach-Object { $path = $_ Add-Content -Path $env:GITHUB_PATH -Value $path - Write-Host "Added $path to `$env:GITHUB_PATH`" + Log -Message "Added $path to `$env:GITHUB_PATH`" } - name: Install Rust