Skip to content

Commit

Permalink
ci: support clang
Browse files Browse the repository at this point in the history
Ubuntu 22.04 have clang 14 by default, which partially supports
consteval - it fails tntcxx build.
  • Loading branch information
drewdzzz committed Jan 14, 2024
1 parent 61d46cf commit ea34338
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/actions/build-tntcxx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ inputs:
default: 'false'
cxx-standard:
desciption: 'Corresponds to CMAKE_CXX_STANDARD option of CMake'
cxx-flags:
desciption: 'Corresponds to CMAKE_CXX_FLAGS option of CMake'
cxx-compiler:
description: 'a'
c-compiler:
description: 'a'
cxx-compiler-flags:
description: 'a'
exe-linker-flags:
description: 'b'

runs:
using: "composite"
Expand All @@ -23,6 +33,10 @@ runs:
-DTNTCXX_ENABLE_SSL=ON \
-DCMAKE_BUILD_TYPE=${{ inputs.build-type }} \
-DTNTCXX_ENABLE_SANITIZERS=${{ inputs.enable-sanitizers }} \
-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }}
-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }} \
-DCMAKE_C_COMPILER=${{ inputs.c-compiler }} \
-DCMAKE_CXX_COMPILER=${{ inputs.cxx-compiler }} \
-DCMAKE_CXX_FLAGS=${{ inputs.cxx-compiler-flags }} \
-DCMAKE_EXE_LINKER_FLAGS=${{ inputs.exe-linker-flags }}
make -j
shell: bash
16 changes: 16 additions & 0 deletions .github/workflows/reusable-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
cxx-standard:
required: false
type: number
c-compiler:
default: gcc
type: string
cxx-compiler:
default: g++
type: string
use-valgrind:
default: false
type: boolean
Expand All @@ -35,12 +41,22 @@ jobs:
if: inputs.use-valgrind
run: sudo apt update && sudo apt install -y valgrind

# https://github.com/actions/runner-images/issues/8659
- name: Remove incompatible libstdc++
if: ${{ inputs.runs-on == 'ubuntu-22.04' && inputs.cxx-compiler == 'clang++' && inputs.cxx-standard == 20 }}
run: |
sudo apt remove gcc-13 g++-13 libstdc++-13-dev gcc g++ libstdc++-dev
sudo apt autoremove
sudo apt install g++-12
- name: Build tntcxx
uses: ./.github/actions/build-tntcxx
with:
build-type: ${{ inputs.build-type }}
enable-sanitizers: ${{ inputs.enable-sanitizers }}
cxx-standard: ${{ inputs.cxx-standard }}
c-compiler: ${{ inputs.c-compiler }}
cxx-compiler: ${{ inputs.cxx-compiler }}

- name: Test tntcxx
uses: ./.github/actions/test-tntcxx
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,27 @@ jobs:
- ubuntu-22.04
- macos-11
- macos-12
compiler:
- {c: gcc, cxx: g++}
- {c: clang, cxx: clang++}
build-type:
- Debug
- RelWithDebInfo
cxx-standard:
- 17
- 20
exclude:
- runs-on: macos-11
compiler: {c: gcc, cxx: g++}
- runs-on: macos-12
compiler: {c: gcc, cxx: g++}
name: default (${{ matrix.runs-on }}, ${{ matrix.build-type }}, ${{ matrix.compiler.c }}, C++${{ matrix.cxx-standard }})
with:
runs-on: ${{ matrix.runs-on }}
build-type: ${{ matrix.build-type }}
cxx-standard: ${{ matrix.cxx-standard }}
c-compiler: ${{ matrix.compiler.c }}
cxx-compiler: ${{ matrix.compiler.cxx }}

valgrind:
uses: ./.github/workflows/reusable-testing.yml
Expand Down

0 comments on commit ea34338

Please sign in to comment.