ci: print env-related settings in each job

To make debugging easier.

Use a separate shell script instead of just a make target to ensure that
it can safely run before ./configure and without having make installed.
This commit is contained in:
Kelvin M. Klann 2023-04-22 18:10:05 -03:00
parent fde591c2b7
commit 339d395fbd
7 changed files with 48 additions and 0 deletions

View file

@ -67,6 +67,8 @@ jobs:
run: sudo apt-get update
- name: install dependencies
run: sudo apt-get install libapparmor-dev libselinux1-dev
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor
@ -92,6 +94,8 @@ jobs:
run: sudo apt-get update
- name: install clang-tools-14 and dependencies
run: sudo apt-get install clang-tools-14 libapparmor-dev libselinux1-dev
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=clang-14 ./configure --enable-fatal-warnings --enable-apparmor

View file

@ -68,6 +68,8 @@ jobs:
sudo apt-get install
gcc-12 libapparmor-dev libselinux1-dev expect xzdec whois
bridge-utils
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings

View file

@ -91,6 +91,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: print env
run: ./ci/printenv.sh
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@b2c19fb9a2a485599ccf4ed5d65527d94bc57226

View file

@ -34,7 +34,10 @@ jobs:
github.com:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: print env
run: ./ci/printenv.sh
- run: python3 --version
# - name: sort.py
# run: >
# ./ci/check/profiles/sort.py

View file

@ -13,6 +13,7 @@ build_ubuntu_package:
- >
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq
build-essential lintian libapparmor-dev pkg-config python3 gawk
- ./ci/printenv.sh
- ./configure
- make deb
- dpkg -i firejail*.deb
@ -27,6 +28,7 @@ build_debian_package:
- >
apt-get install -y -qq
build-essential lintian libapparmor-dev pkg-config gawk
- ./ci/printenv.sh
- ./configure
- make deb
- dpkg -i firejail*.deb
@ -37,6 +39,7 @@ build_redhat_package:
script:
- dnf update -y
- dnf install -y rpm-build gcc make
- ./ci/printenv.sh
- ./configure --prefix=/usr
- make rpms
- rpm -i firejail*.rpm
@ -47,6 +50,7 @@ build_fedora_package:
script:
- dnf update -y
- dnf install -y rpm-build gcc make
- ./ci/printenv.sh
- ./configure --prefix=/usr
- make rpms
- rpm -i firejail*.rpm
@ -60,6 +64,7 @@ build_src_package:
- apk update
- apk upgrade
- apk add build-base linux-headers python3 gawk
- ./ci/printenv.sh
- ./configure --prefix=/usr
- make
- make install-strip
@ -74,6 +79,7 @@ build_no_apparmor:
- >
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq
build-essential lintian pkg-config gawk
- ./ci/printenv.sh
- ./configure
- make dist
- ./mkdeb.sh --disable-apparmor
@ -117,5 +123,6 @@ debian_ci:
- export CI_COMMIT_SHA="$(git rev-parse HEAD)"
script:
- apt-get --no-install-recommends install -y -qq gawk
- ./ci/printenv.sh
- gitlab-ci-git-buildpackage
- gitlab-ci-lintian

View file

@ -364,6 +364,10 @@ scan-build: clean
codespell: clean
codespell --ignore-regex "UE|creat|shotcut|ether" src test
.PHONY: print-env
print-env:
./ci/printenv.sh
#
# make test
#

25
ci/printenv.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
# Print information that may be useful for debugging CI.
test -f /etc/os-release && . /etc/os-release
cat <<EOF
nproc: $(nproc)
kernel: $(uname -srvm)
distro: $PRETTY_NAME
sh: $(ls -l /bin/sh | sed 's|.* /bin|/bin|')
user: $(id | cut -f -2 -d ' ')
[/etc/os-release]
$(cat /etc/os-release)
EOF
if test -z "$CI_VERBOSE"; then
exit
fi
cat <<EOF
[env]
$(env | LC_ALL=C sort)
EOF