From 2b9a3ec5d2a08f08e296cff460d97ffb83ed9bef Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Tue, 31 Aug 2021 09:58:27 -0400 Subject: [PATCH] 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. --- .github/workflows/centos.yml | 5 +++++ .github/workflows/print_versions.sh | 13 +++++++++++++ .github/workflows/ubuntu.yml | 4 ++++ 3 files changed, 22 insertions(+) create mode 100755 .github/workflows/print_versions.sh diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index 06e8015a578..be01ff4717d 100644 --- a/.github/workflows/centos.yml +++ b/.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 diff --git a/.github/workflows/print_versions.sh b/.github/workflows/print_versions.sh new file mode 100755 index 00000000000..e6deff3a613 --- /dev/null +++ b/.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 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6041429790e..9f5b8dae44e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.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