GCC 11/12/13 #601
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GCC 11/12/13 | |
on: | |
workflow_run: | |
workflows: [Generate single-include header] | |
types: | |
- completed | |
jobs: | |
gcc: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [11, 12, 13] | |
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 compiler | |
if: ${{ matrix.version >= 13 }} | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get install gcc-${{ matrix.version }} g++-${{ matrix.version }} | |
- name: Configure | |
shell: cmake -P {0} | |
run: | | |
set(ENV{CC} "/usr/bin/gcc-${{ matrix.version }}") | |
set(ENV{CXX} "/usr/bin/g++-${{ 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 CMAKE_MAKE_PROGRAM=${ninja_program} | |
-D ECS_COMPILE_AS_MODULE=false | |
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() |