name: Ubuntu 22.04 CI (GCC 12)

on: [push, pull_request]

jobs:
  ubuntu-build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v6.0.2
      - name: Use cmake
        run: |
          mkdir build &&
          cd build &&
          CXX=g++-12 CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON  ..  &&
          cmake --build .   &&
          ctest --output-on-failure
      - name: Use cmake CXX20
        run: |
          mkdir build20 &&
          cd build20 &&
          CXX=g++-12 CXXFLAGS=-Werror cmake -DFASTFLOAT_CONSTEXPR_TESTS=ON -DFASTFLOAT_CXX_STANDARD=20 -DFASTFLOAT_TEST=ON  ..  &&
          cmake --build .   &&
          ctest --output-on-failure