| 1 |
# Get the short version of coqc |
| 2 |
$COQC_VERSION_SHORT = & opam exec -- coqc --print-version 2>$null | Select-Object -First 1 |
| 3 |
|
| 4 |
# Get the full version of coqc, replace new lines with commas, and remove trailing comma |
| 5 |
$COQC_VERSION = & opam exec -- coqc --version 2>$null | ForEach-Object { $_ -join ',' } | ForEach-Object { $_ -replace ',$', '' } |
| 6 |
|
| 7 |
# Run coqtop and capture both stdout and stderr |
| 8 |
$COQTOP_VERSION = "" | & opam exec -- coqtop 2>$null |
| 9 |
|
| 10 |
# Check if GITHUB_STEP_SUMMARY and COQC_VERSION are not empty |
| 11 |
if (![string]::IsNullOrEmpty($env:GITHUB_STEP_SUMMARY) -and ![string]::IsNullOrEmpty($COQC_VERSION)) { |
| 12 |
# Append details to GITHUB_STEP_SUMMARY |
| 13 |
"<details><summary>$COQC_VERSION</summary>" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append |
| 14 |
"``````" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append |
| 15 |
$COQTOP_VERSION | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append |
| 16 |
"``````" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append |
| 17 |
"</details>" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append |
| 18 |
} |