Skip to content

Add cpp version to ci #113

Add cpp version to ci

Add cpp version to ci #113

Workflow file for this run

name: Single-Platform Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
build_type: [Release, Debug]
cpp_ver: [20, 23, 26]
compiler:
- cxx: g++
ver: 13
- cxx: g++
ver: 14
- cxx: clang++
ver: 19
- cxx: clang++
ver: 20
exclude:
- compiler:
cxx: g++
ver: 13
cpp_ver: 26
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "cxx-compiler=${{ matrix.compiler.cxx }}-${{ matrix.compiler.ver }}" >> "$GITHUB_OUTPUT"
- name: Setup Clang
if: matrix.compiler.cxx == 'clang++'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{ matrix.compiler.ver }} all
- name: Setup GCC
if: matrix.compiler.cxx == 'g++'
run: sudo apt update && sudo apt install -y g++-${{ matrix.compiler.ver }}
- name: Install Deps
run: sudo apt update && sudo apt install libboost-test-dev
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ steps.strings.outputs.cxx-compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_ver }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --target yk_util_test
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}/test
run: ./yk_util_test --report_level=short