Skip to content

Clang 17-18

Clang 17-18 #397

Workflow file for this run

name: Clang 16-18 (module)
on:
workflow_run:
workflows: [Generate single-include header]
types:
- completed
jobs:
clang:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: true
matrix:
version: [17, 18]
modules: [false, true]
built_type: [Debug, Release]
steps:
- uses: actions/checkout@v3
with:
submodules: true # recursive
- name: Download Ninja
shell: cmake -P {0}
run: |
set(ninja_version "1.11.1") # needed for module support
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-linux.zip")
file(DOWNLOAD "${ninja_url}" ./ninja.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ./ninja.zip)
execute_process(COMMAND chmod +x ninja)
- name: Install clang ${{ matrix.version }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.version }}
sudo apt install clang-tools-${{ matrix.version }}
#sudo apt remove libstdc++-13-dev
#sudo apt install libstdc++-12-dev
- name: Configure
shell: cmake -P {0}
run: |
set(ENV{CC} "/usr/bin/clang-${{ matrix.version }}")
set(ENV{CXX} "/usr/bin/clang++-${{ matrix.version }}")
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/ninja" ninja_program)
execute_process(
COMMAND cmake
-S .
-B build
-G Ninja
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
-D ECS_COMPILE_AS_MODULE=${{ matrix.modules }}
-D CMAKE_MAKE_PROGRAM=${ninja_program}
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: Build
shell: cmake -P {0}
run: |
set(ENV{NINJA_STATUS} "[%f/%t %e sec] ")
execute_process(
COMMAND cmake --build build
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "CMake build failed")
endif()
- name: Run tests
shell: cmake -P {0}
run: |
include(ProcessorCount)
ProcessorCount(N)
execute_process(
COMMAND ctest --output-on-failure -j ${N}
WORKING_DIRECTORY build
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Running tests failed!")
endif()