Skip to content

Cannot get gcc-15 on Ubuntu 24.04 (latest) #3

Cannot get gcc-15 on Ubuntu 24.04 (latest)

Cannot get gcc-15 on Ubuntu 24.04 (latest) #3

Workflow file for this run

name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build with ${{ matrix.compiler.c }}-${{ matrix.compiler.version }} in ${{ matrix.build_type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [ Debug ]
compiler:
- { c: gcc, cxx: g++, version: "14" }
# - { c: gcc, cxx: g++, version: "15" } # Only available on Ubuntu 25.04 "Plucky"
- { c: clang, cxx: clang++, version: "19" }
- { c: clang, cxx: clang++, version: "20" }
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.compiler.c }}-${{ matrix.compiler.version }}
run: |
if [[ "${{ matrix.compiler.c }}" == "gcc" ]]; then
PACKAGES="gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }}"
elif [[ "${{ matrix.compiler.c }}" == "clang" ]]; then
CODENAME=$(lsb_release -sc)
PACKAGES=clang-${{ matrix.compiler.version }}
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm.gpg > /dev/null
sudo add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${{ matrix.compiler.version }} main"
fi
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${PACKAGES}
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }}-${{ matrix.compiler.version }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}-${{ matrix.compiler.version }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DSIMPLY_INSTALL_PRE_COMMIT_HOOKS=OFF \
-S ${{ github.workspace }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --build-config ${{ matrix.build_type }}