name: C/Fortran

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-22.04, macos-13]
        compiler: [gcc-13, clang]
        include:
        - os: ubuntu-22.04
          asan: 1

    runs-on: ${{ matrix.os }}

    steps:
    - name: Environment setup
      uses: actions/checkout@v4
    - name: Build and test libCEED
      env:
        CC: ${{ matrix.compiler }}
        FC: gfortran-13
        AFLAGS: -fsanitize=address -fsanitize=leak
        ASAN: ${{ matrix.asan }}
      run: |
        make -v
        make info
        make -j2
        PROVE_OPTS=-v make prove -j2
