name: CI Linux GCC

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install GCC
        run: sudo apt-get update && sudo apt-get install -y build-essential

      - name: Configure CMake (with tests)
        run: >
          cmake -B build \
            -DCMAKE_C_COMPILER=gcc \
            -DCMAKE_CXX_COMPILER=g++ \
            -DCMAKE_BUILD_TYPE=Release \
            -DUTF8CPP_ENABLE_TESTS=ON \
            -S .

      - name: Build
        run: cmake --build build --config Release

      - name: Test
        working-directory: build
        run: ctest -VV
