|
| 1 | +# Ensure this script is only running in a subprocess |
| 2 | +if (-not $env:in_subprocess) { |
| 3 | + $env:in_subprocess = "y" |
| 4 | + Start-Process PowerShell.exe -ArgumentList "-NoExit", "-File", "$PSCommandPath", "@args" |
| 5 | + exit |
| 6 | +} |
| 7 | + |
| 8 | +# Set the script directory variable |
| 9 | +$SCRIPT_DIR = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition |
| 10 | + |
| 11 | +# Function to print groups for better readability in logs |
| 12 | +function Print-Group { |
| 13 | + param ($name, $command) |
| 14 | + Write-Host "::group::$name" |
| 15 | + & $command -ErrorAction Continue |
| 16 | + Write-Host "::endgroup::" |
| 17 | +} |
| 18 | + |
| 19 | +# Using WMI to get CPU information |
| 20 | +Print-Group -name "wmic cpu get" -command { wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status } |
| 21 | +Print-Group -name "wmic cpu list /format:list" -command { wmic cpu list /format:list } |
| 22 | + |
| 23 | +# Running git configuration commands via bash |
| 24 | +$CYGWIN_ROOT = $env:CYGWIN_ROOT |
| 25 | +Print-Group -name "git config -l" -command { & "$CYGWIN_ROOT\bin\bash.exe" -l -c 'git config -l' } |
| 26 | +Print-Group -name "git config --global -l" -command { & "$CYGWIN_ROOT\bin\bash.exe" -l -c 'git config --global -l' } |
| 27 | + |
| 28 | +# Using opam and OCaml tools |
| 29 | +Print-Group -name "opam list" -command { opam list } |
| 30 | +Print-Group -name "ocamlc -config" -command { opam exec -- ocamlc -config } |
| 31 | +Print-Group -name "coqc --config" -command { opam exec -- coqc --config } |
| 32 | +Print-Group -name "coqc --version" -command { opam exec -- coqc --version } |
| 33 | +Print-Group -name "coqtop version" -command { "" | opam exec -- coqtop } |
| 34 | + |
| 35 | +# Using make with environmental variables |
| 36 | +Print-Group -name "make printenv" -command { & "$CYGWIN_ROOT\bin\bash.exe" -l -c 'cd "$PWD"; opam exec -- make printenv' } |
| 37 | +Print-Group -name "PATH" -command { & "$CYGWIN_ROOT\bin\bash.exe" -l -c 'cd "$PWD"; echo "${PATH}"' } |
| 38 | + |
| 39 | +# Executing another PowerShell script |
| 40 | +& PowerShell.exe -ExecutionPolicy Bypass -File "$SCRIPT_DIR\github-actions-record-coq-info.ps1" |
0 commit comments