From 97d7babafb10805aac298f68980adbfebcc485f5 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Thu, 13 Jun 2024 00:25:01 +0300 Subject: [PATCH] Refactor GitHub Actions --- .github/workflows/cmake-multi-platform.yml | 12 ++---------- .github/workflows/cpack-multi-platform.yml | 5 +++-- scripts/install-blake3.sh | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 505854c..468629b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ ubuntu-24.04, macos-latest ] - build_type: [ Debug ] #[ Debug, Release ] + build_type: [ Debug ] c_compiler: [ clang ] include: - os: macos-latest @@ -24,14 +24,6 @@ jobs: c_compiler: clang cpp_compiler: clang++-18 - # Don't include the following configurations in the matrix -# exclude: -# - os: macos-latest -# build_type: Debug -# -# - os: ubuntu-24.04 -# build_type: Release - steps: - name: Install Dependencies if: matrix.os == 'macos-latest' @@ -66,7 +58,7 @@ jobs: - name: Configure CMake if: matrix.os == 'macos-latest' - run: > + run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang diff --git a/.github/workflows/cpack-multi-platform.yml b/.github/workflows/cpack-multi-platform.yml index 720e96c..757adf6 100644 --- a/.github/workflows/cpack-multi-platform.yml +++ b/.github/workflows/cpack-multi-platform.yml @@ -58,11 +58,12 @@ jobs: - name: Configure CMake if: matrix.os == 'macos-latest' - run: > + run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang - -DCMAKE_CXX_FLAGS=" -stdlib=libstdc++ -stdlib++-isystem /opt/homebrew/Cellar/gcc/14.1.0_1/include/c++/14 -cxx-isystem /opt/homebrew/Cellar/gcc/14.1.0_1/include/c++/14/aarch64-apple-darwin23 -L /opt/homebrew/Cellar/gcc/14.1.0_1/lib/gcc/14 -Wl,-rpath,/opt/homebrew/opt/gcc/lib/gcc/current" + -DCMAKE_CXX_FLAGS="-stdlib++-isystem /opt/homebrew/Cellar/gcc/14.1.0_1/include/c++/14 -cxx-isystem /opt/homebrew/Cellar/gcc/14.1.0_1/include/c++/14/aarch64-apple-darwin23" + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libstdc++ -L /opt/homebrew/Cellar/gcc/14.1.0_1/lib/gcc/14 -Wl,-rpath,/opt/homebrew/opt/gcc/lib/gcc/current" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} -G Ninja diff --git a/scripts/install-blake3.sh b/scripts/install-blake3.sh index 77c4c8a..cd740d9 100755 --- a/scripts/install-blake3.sh +++ b/scripts/install-blake3.sh @@ -40,7 +40,7 @@ install_blake3() { cd BLAKE3-1.5.1/c || error_exit "Failed to navigate to BLAKE3/c directory." - cmake -B build -DCMAKE_C_COMPILER="$C_COMPILER" -G Ninja || error_exit "Failed to run cmake." + cmake -B build -DCMAKE_C_COMPILER="$C_COMPILER" -DCMAKE_BUILD_TYPE=Release -G Ninja || error_exit "Failed to configure CMake." get_number_of_processors cmake --build build --config Release --target install -j "$NUMBER_OF_PROCESSORS" || error_exit "Failed to build and install."