Skip to content

Commit 5824db7

Browse files
committed
Record coq version info to GITHUB_STEP_SUMMARY for easier access
1 parent e752f1b commit 5824db7

5 files changed

+48
-12
lines changed

etc/ci/describe-system-config-macos.sh

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ group coqc --config
3535
group coqc --version
3636
group "true | coqtop"
3737
group etc/machine.sh
38+
etc/ci/github-actions-record-coq-info.sh

etc/ci/describe-system-config-win.bat

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
@echo off
2-
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
2+
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit
3+
4+
SET "SCRIPT_DIR=%~dp0"
35

46
ECHO ::group::wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status
5-
wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status
7+
wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status &
68
ECHO ::endgroup::
79
ECHO ::group::wmic cpu list /format:list
8-
wmic cpu list /format:list
10+
wmic cpu list /format:list &
911
ECHO ::endgroup::
1012
ECHO ::group::git config -l
11-
%CYGWIN_ROOT%\bin\bash.exe -l -c 'git config -l'
13+
%CYGWIN_ROOT%\bin\bash.exe -l -c 'git config -l' &
1214
ECHO ::endgroup::
1315
ECHO ::group::git config --global -l
14-
%CYGWIN_ROOT%\bin\bash.exe -l -c 'git config --global -l'
16+
%CYGWIN_ROOT%\bin\bash.exe -l -c 'git config --global -l' &
1517
ECHO ::endgroup::
1618
ECHO ::group::opam list
17-
opam list
19+
opam list &
1820
ECHO ::endgroup::
1921
ECHO ::group::ocamlc -config
20-
opam exec -- ocamlc -config
22+
opam exec -- ocamlc -config &
2123
ECHO ::endgroup::
2224
ECHO ::group::coqc --config
23-
opam exec -- coqc --config
25+
opam exec -- coqc --config &
2426
ECHO ::endgroup::
2527
ECHO ::group::coqc --version
26-
opam exec -- coqc --version
28+
opam exec -- coqc --version &
2729
ECHO ::endgroup::
2830
ECHO ::group::coqtop version
29-
echo | opam exec -- coqtop
31+
opam exec -- coqtop <nul &
3032
ECHO ::endgroup::
3133
ECHO ::group::make printenv
32-
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- make printenv'
34+
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- make printenv' &
3335
ECHO ::endgroup::
3436
ECHO ::group::PATH
35-
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; echo "${PATH}"'
37+
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; echo "${PATH}"' &
3638
ECHO ::endgroup::
39+
40+
powershell -ExecutionPolicy Bypass -File "%SCRIPT_DIR%github-actions-record-coq-info.ps1"

etc/ci/describe-system-config.sh

+1
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ group "true | coqtop"
6262
group etc/machine.sh
6363
group "echo PATH=$PATH"
6464
group "echo SHELL=$SHELL"
65+
etc/ci/github-actions-record-coq-info.sh
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# summarize coqc version to make it easier to read
4+
COQC_VERSION_SHORT="$(coqc --print-version 2>/dev/null | cut -d " " -f 1)"
5+
COQC_VERSION="$(coqc --version 2>/dev/null | tr '\n' ',' | sed 's/,$//g')"
6+
COQTOP_VERSION="$(true | coqtop 2>&1)"
7+
if [ ! -z "$GITHUB_STEP_SUMMARY" ] && [ ! -z "$COQC_VERSION" ]; then
8+
printf '%s\n\n' "<details><summary>${COQC_VERSION}</summary>" >> "$GITHUB_STEP_SUMMARY"
9+
printf '%s\n' '```' >> "$GITHUB_STEP_SUMMARY"
10+
printf '%s\n' "${COQTOP_VERSION} >> "$GITHUB_STEP_SUMMARY"
11+
printf '%s\n%s\n' '```' '</details>' >> "$GITHUB_STEP_SUMMARY"
12+
fi

0 commit comments

Comments
 (0)