From 52a958270f038b11ac9dc795380311fcaa22b3c7 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Fri, 25 Oct 2019 22:05:02 +0200 Subject: [PATCH] Log environment on CI machines log-env.sh is cross-platform (works on Linux, MacOS and Windows) log-env.ps1 is Windows-only and requirs specifying pwsh shell, but provides some Windows-specific information, that might be useful e.g. for MSVC builds. --- .github/workflows/build.yml | 14 ++++++++++++++ .github/workflows/static.yml | 2 ++ scripts/log-env.ps1 | 13 +++++++++++++ scripts/log-env.sh | 16 ++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 scripts/log-env.ps1 create mode 100755 scripts/log-env.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56b96c5e..6009d925 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 + - name: "Log environment" + run: ./scripts/log-env.sh - run: sudo apt update - name: "Install packages" run: sudo apt-get install g++-9 libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev @@ -34,6 +36,8 @@ jobs: os: [ubuntu-18.04, ubuntu-16.04] steps: - uses: actions/checkout@v1 + - name: "Log environment" + run: ./scripts/log-env.sh - run: sudo apt update - name: "Install packages" run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev @@ -53,6 +57,8 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 + - name: "Log environment" + run: ./scripts/log-env.sh - run: sudo apt update - name: "Install packages" run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev @@ -75,6 +81,8 @@ jobs: runs-on: macOS-10.14 steps: - uses: actions/checkout@v1 + - name: "Log environment" + run: ./scripts/log-env.sh - run: brew update - name: "Install packages" run: brew install automake libpng sdl sdl_net sdl_sound @@ -94,6 +102,9 @@ jobs: runs-on: windows-2019 steps: - uses: actions/checkout@v1 + - name: "Log environment" + shell: pwsh + run: .\scripts\log-env.ps1 - name: "Install packages" shell: pwsh run: | @@ -113,6 +124,9 @@ jobs: runs-on: windows-2019 steps: - uses: actions/checkout@v1 + - name: "Log environment" + shell: pwsh + run: .\scripts\log-env.ps1 - name: "Install packages" shell: pwsh run: | diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index be6202cf..7817b808 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 + - name: "Log environment" + run: ./scripts/log-env.sh - run: sudo apt update - name: "Install packages" run: sudo apt-get install libsdl1.2-dev libsdl-net1.2-dev libsdl-sound1.2-dev python3-setuptools diff --git a/scripts/log-env.ps1 b/scripts/log-env.ps1 new file mode 100644 index 00000000..2b1bc4d1 --- /dev/null +++ b/scripts/log-env.ps1 @@ -0,0 +1,13 @@ +# To use this script in GitHub Actions job: +# +# - name: "Log environment" +# shell: pwsh +# run: .\scripts\log-env.ps1 +# +# This script works only on Windows. +# see also script: log-env.sh + +Set-PSDebug -Trace 1 +systeminfo +gci env: +Set-PSDebug -Trace 0 diff --git a/scripts/log-env.sh b/scripts/log-env.sh new file mode 100755 index 00000000..14dd20b7 --- /dev/null +++ b/scripts/log-env.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# To use this script in GitHub Actions job: +# +# - name: "Log environment" +# shell: bash +# run: ./scripts/log-env.sh +# +# Line "shell: bash" is optional for Linux and MacOS, +# but required for Windows; see also script: log-env.ps1 + +set -x +uname -a +uname -s +uname -m +env