Skip to content

Commit

Permalink
Use makefile on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Jul 11, 2024
1 parent 2b6e8c2 commit 0474dd3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 37 deletions.
46 changes: 24 additions & 22 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: linux CI

on:
push:
branches: [ "develop", "master" ]
branches: ["develop", "master"]
pull_request:
branches: [ "develop" ]
branches: ["develop"]

permissions:
contents: read
Expand All @@ -19,7 +19,7 @@ jobs:
compiler:
- {cxx: "g++-14"}
- {cxx: "clang++-18"}
type: [static, shared]
type: [shared]
build_type: [Release]
cxx_std: [23]

Expand All @@ -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
27 changes: 14 additions & 13 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---
name: macos CI

on:
push:
branches: [ "develop", "master" ]
branches: ["develop", "master"]
pull_request:
branches: [ "develop" ]
branches: ["develop"]

jobs:
build:

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
4 changes: 2 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0474dd3

Please sign in to comment.