Skip to content

Commit

Permalink
chore: use nushell in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
oberrich committed Jan 10, 2025
1 parent c58da7e commit 139a74f
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,43 @@ 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,
[Parameter(Mandatory=$true)] [scriptblock]$Action,
[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 = @(
Expand All @@ -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
Expand Down

0 comments on commit 139a74f

Please sign in to comment.