From e9f3a5fd1badcda2d10f0469e9747d6952ea89eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Bari=C5=A1i=C4=87?= <48765171+MarkoBarisic@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:17:16 +0200 Subject: [PATCH] Fix default value in release workflows (#1418) --- .github/workflows/release_centos8.yaml | 14 +++++++++++--- .github/workflows/release_debian10.yaml | 19 ++++++++++++++++--- .github/workflows/release_ubuntu2004.yaml | 12 ++++++++++-- CMakeLists.txt | 3 +++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release_centos8.yaml b/.github/workflows/release_centos8.yaml index a72a1c053..d1dd2c6d9 100644 --- a/.github/workflows/release_centos8.yaml +++ b/.github/workflows/release_centos8.yaml @@ -40,9 +40,13 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build community binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} -DMG_ENTERPRISE=OFF .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMG_ENTERPRISE=OFF .. make -j$THREADS - name: Run unit tests @@ -197,11 +201,15 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build release binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. make -j$THREADS - + - name: Create enterprise RPM package run: | # Activate toolchain. diff --git a/.github/workflows/release_debian10.yaml b/.github/workflows/release_debian10.yaml index 88d623b0e..277d4c55e 100644 --- a/.github/workflows/release_debian10.yaml +++ b/.github/workflows/release_debian10.yaml @@ -40,9 +40,13 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build community binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} -DMG_ENTERPRISE=OFF .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMG_ENTERPRISE=OFF .. make -j$THREADS - name: Run unit tests @@ -197,9 +201,13 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build release binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. make -j$THREADS - name: Create enterprise DEB package @@ -329,9 +337,14 @@ jobs: source /opt/toolchain-v4/activate # Initialize dependencies. ./init + + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build only memgraph release binary. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. make -j$THREADS memgraph - name: Run Jepsen tests diff --git a/.github/workflows/release_ubuntu2004.yaml b/.github/workflows/release_ubuntu2004.yaml index cb788e58e..a2eb97c06 100644 --- a/.github/workflows/release_ubuntu2004.yaml +++ b/.github/workflows/release_ubuntu2004.yaml @@ -40,9 +40,13 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build community binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} -DMG_ENTERPRISE=OFF .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMG_ENTERPRISE=OFF .. make -j$THREADS - name: Run unit tests @@ -197,9 +201,13 @@ jobs: # Initialize dependencies. ./init + # Set default build_type to Release + INPUT_BUILD_TYPE=${{ github.event.inputs.build_type }} + BUILD_TYPE=${INPUT_BUILD_TYPE:-"Release"} + # Build release binaries. cd build - cmake -DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} .. + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. make -j$THREADS - name: Create enterprise DEB package diff --git a/CMakeLists.txt b/CMakeLists.txt index f04f079bd..1933689fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,6 +239,9 @@ else() endif() # ----------------------------------------------------------------------------- +if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) + message(FATAL_ERROR "CMake build type was set as empty, most likely a mistake") +endif() # default build type is debug if (NOT CMAKE_BUILD_TYPE)