From 339d395fbdceabc6b8f70116823abcae5e1e18d5 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 22 Apr 2023 18:10:05 -0300 Subject: 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. --- .github/workflows/build-extra.yml | 4 ++++ .github/workflows/build.yml | 2 ++ .github/workflows/codeql-analysis.yml | 3 +++ .github/workflows/profile-checks.yml | 3 +++ .gitlab-ci.yml | 7 +++++++ Makefile | 4 ++++ ci/printenv.sh | 25 +++++++++++++++++++++++++ 7 files changed, 48 insertions(+) create mode 100755 ci/printenv.sh diff --git a/.github/workflows/build-extra.yml b/.github/workflows/build-extra.yml index d11c10718..04023ab45 100644 --- a/.github/workflows/build-extra.yml +++ b/.github/workflows/build-extra.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4af788044..b72bdd611 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 952185b8a..e1353aa86 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/.github/workflows/profile-checks.yml b/.github/workflows/profile-checks.yml index fc23f5fa1..9d9e67fe6 100644 --- a/.github/workflows/profile-checks.yml +++ b/.github/workflows/profile-checks.yml @@ -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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9500415a1..8229c6575 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/Makefile b/Makefile index 98f368789..749457b1b 100644 --- a/Makefile +++ b/Makefile @@ -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 # diff --git a/ci/printenv.sh b/ci/printenv.sh new file mode 100755 index 000000000..4b7e03fa7 --- /dev/null +++ b/ci/printenv.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Print information that may be useful for debugging CI. + +test -f /etc/os-release && . /etc/os-release + +cat <