Ver código fonte

ci: Print version info for Ubuntu and CentOS runs (#1832)

To clearly show what version was installed and what dependencies are used, this prints version info at the end of Ubuntu and CentOS workflows (regardless of build status so possibly failing when GRASS GIS does not build correctly). This includes dependencies and extended Python version info using the Python set in the GRASS_PYTHON variable.
Vaclav Petras 3 anos atrás
pai
commit
2b9a3ec5d2

+ 5 - 0
.github/workflows/centos.yml

@@ -56,3 +56,8 @@ jobs:
         run: |
           source $CONDA_ACTIVATE
           .github/workflows/test_simple.sh
+      - name: Print installed versions
+        if: always()
+        run: |
+          source $CONDA_ACTIVATE
+          .github/workflows/print_versions.sh

+ 13 - 0
.github/workflows/print_versions.sh

@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Print versions, esp. versions of dependencies.
+
+# fail on non-zero return code from a subprocess
+set -e
+
+grass --version
+grass --tmp-location XY --exec g.version -e
+# Detailed Python version info (in one line thanks to echo)
+grass --tmp-location XY --exec bash -c "echo Python: \$(\$GRASS_PYTHON -c 'import sys; print(sys.version)')"
+python3 --version
+python --version

+ 4 - 0
.github/workflows/ubuntu.yml

@@ -59,3 +59,7 @@ jobs:
           name: testreport-${{ matrix.os }}
           path: testreport
           retention-days: 3
+
+      - name: Print installed versions
+        if: always()
+        run: .github/workflows/print_versions.sh