From 0474dd3e697d51c61db6cb8758c89ce8043df620 Mon Sep 17 00:00:00 2001 From: Claus Klein Date: Thu, 11 Jul 2024 19:25:21 +0200 Subject: [PATCH] Use makefile on CI --- .github/workflows/linux.yml | 46 +++++++++++++++++++------------------ .github/workflows/macos.yml | 27 +++++++++++----------- GNUmakefile | 4 ++-- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5e3ddd1..51faf12 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,9 +3,9 @@ name: linux CI on: push: - branches: [ "develop", "master" ] + branches: ["develop", "master"] pull_request: - branches: [ "develop" ] + branches: ["develop"] permissions: contents: read @@ -19,7 +19,7 @@ jobs: compiler: - {cxx: "g++-14"} - {cxx: "clang++-18"} - type: [static, shared] + type: [shared] build_type: [Release] cxx_std: [23] @@ -42,30 +42,32 @@ jobs: sudo apt-get install -y --no-install-recommends ninja-build \ libc++-18-dev libc++abi-18-dev clang-tidy-18 libunwind-18-dev llvm-18 libfuzzer-18-dev export LLVM_ROOT=/usr/lib/llvm-18 && echo "LLVM_ROOT=$LLVM_ROOT" >> $GITHUB_ENV + export CXX=${{matrix.compiler.cxx}} && echo "CXX=$CXX" >> $GITHUB_ENV - name: Create Build Environment run: | cmake --version ninja --version - cmake -E make_directory ${{runner.workspace}}/build + make + # XXX cmake -E make_directory ${{runner.workspace}}/build - - name: Configure - working-directory: ${{runner.workspace}}/build - run: | - cmake -G Ninja \ - -D CMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \ - -D CMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -D CMAKE_CXX_STANDARD=${{matrix.cxx_std}} \ - -D BUILD_SHARED_LIBS=${{matrix.build}} \ - $GITHUB_WORKSPACE + # - name: Configure + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake -G Ninja \ + # -D CMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \ + # -D CMAKE_BUILD_TYPE=${{matrix.build_type}} \ + # -D CMAKE_CXX_STANDARD=${{matrix.cxx_std}} \ + # -D BUILD_SHARED_LIBS=${{matrix.build}} \ + # $GITHUB_WORKSPACE - - name: Build - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --config ${{matrix.build_type}} -- -k999 + # - name: Build + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake --build . --config ${{matrix.build_type}} -- -k999 - - name: Test - working-directory: ${{runner.workspace}}/build - run: ctest -C ${{matrix.build_type}} --timeout 60 - env: - CTEST_OUTPUT_ON_FAILURE: True + # - name: Test + # working-directory: ${{runner.workspace}}/build + # run: ctest -C ${{matrix.build_type}} --timeout 60 + # env: + # CTEST_OUTPUT_ON_FAILURE: True diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e76dddf..925e65a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,10 +1,11 @@ +--- name: macos CI on: push: - branches: [ "develop", "master" ] + branches: ["develop", "master"] pull_request: - branches: [ "develop" ] + branches: ["develop"] jobs: build: @@ -12,16 +13,16 @@ jobs: runs-on: macos-14 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Install llvm-18 - run: | - brew install llvm ninja codespell cmake ninja - export PATH="$(brew --prefix llvm@18)/bin:$PATH" && echo "PATH=$PATH" >> $GITHUB_ENV - export LDFLAGS="-L$(brew --prefix llvm@18)/lib/c++ $LDFLAGS" && echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV - export LLVM_ROOT="$(brew --prefix llvm@18)" && echo "LLVM_ROOT=$LLVM_ROOT" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV - echo "CC=clang-18" >> $GITHUB_ENV + - name: Install llvm-18 + run: | + brew install llvm ninja codespell cmake ninja + export PATH="$(brew --prefix llvm@18)/bin:$PATH" && echo "PATH=$PATH" >> $GITHUB_ENV + export LDFLAGS="-L$(brew --prefix llvm@18)/lib/c++ $LDFLAGS" && echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV + export LLVM_ROOT="$(brew --prefix llvm@18)" && echo "LLVM_ROOT=$LLVM_ROOT" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV + echo "CC=clang-18" >> $GITHUB_ENV - - name: Build - run: make + - name: Build + run: make diff --git a/GNUmakefile b/GNUmakefile index ef5f02b..6d4c049 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,13 +7,13 @@ ifeq (${UNAME},Darwin) export LLVM_ROOT:=$(shell realpath ${LLVM_PREFIX}) export LDFLAGS+=-L${LLVM_ROOT}/lib/c++ export PATH:=${LLVM_ROOT}/bin:${PATH} + export CXX:=clang++ + export CC:=clang else ifeq (${UNAME},Linux) export LLVM_ROOT:=/usr/lib/llvm-17 endif export CXXFLAGS:=-std=c++23 -export CXX:=clang++ -export CC:=clang .PHONY: all build install format clean distclean all: stagedir build