From bf32069382930c5de352ebd763332f3864c0cadf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 26 Jan 2021 12:39:22 +0100 Subject: [PATCH] github: make sure compiler is defined Signed-off-by: Karel Zak --- .github/workflows/cibuild-setup-ubuntu.sh | 12 ------------ .github/workflows/cibuild.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cibuild-setup-ubuntu.sh b/.github/workflows/cibuild-setup-ubuntu.sh index 160d0301d..8c56ea2ac 100755 --- a/.github/workflows/cibuild-setup-ubuntu.sh +++ b/.github/workflows/cibuild-setup-ubuntu.sh @@ -36,29 +36,17 @@ if [[ "$COMPILER" == clang ]]; then wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - add-apt-repository -y "deb http://apt.llvm.org/$RELEASE/ llvm-toolchain-$RELEASE-$COMPILER_VERSION main" PACKAGES+=(clang-$COMPILER_VERSION lldb-$COMPILER_VERSION lld-$COMPILER_VERSION clangd-$COMPILER_VERSION) - CC="clang-$COMPILER_VERSION" - CXX="clang++-$COMPILER_VERSION" - AR="llvm-ar-$COMPILER_VERSION" elif [[ "$COMPILER" == gcc ]]; then # Latest gcc stack deb packages provided by # https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test add-apt-repository -y ppa:ubuntu-toolchain-r/test PACKAGES+=(gcc-$COMPILER_VERSION) - CC="gcc-$COMPILER_VERSION" - CXX="g++-$COMPILER_VERSION" - AR="gcc-ar-$COMPILER_VERSION" else fatal "Unknown compiler: $COMPILER" fi -export CC="$CC" -export CXX="$CXX" -export AR="$AR" - apt-get -y update --fix-missing apt-get -y build-dep util-linux apt-get -y install "${PACKAGES[@]}" apt-get -y install "${PACKAGES_OPTIONAL[@]}" || true - -export PATH="$HOME/.local/bin:$PATH" diff --git a/.github/workflows/cibuild.sh b/.github/workflows/cibuild.sh index a2dfa3408..8256be965 100755 --- a/.github/workflows/cibuild.sh +++ b/.github/workflows/cibuild.sh @@ -2,9 +2,21 @@ PHASES=(${@:-CONFIGURE MAKE INSTALL CHECK DISTCHECK}) COMPILER="${COMPILER:?}" +COMPILER_VERSION="${COMPILER_VERSION:?}" + +if [[ "$COMPILER" == clang ]]; then + CC="clang" + CXX="clang++" +elif [[ "$COMPILER" == gcc ]]; then + CC="gcc" + CXX="g++" +fi set -ex +export CC="$CC" +export CXX="$CXX" + for phase in "${PHASES[@]}"; do case $phase in CONFIGURE)