xref: /libCEED/.github/workflows/c-fortran-test-linux-osx.yml (revision 79b8f26d59e0cb873c9646613d2a970c85250a64)
1dfb8ed23Sjeremyltname: C/Fortran
23446d1b5SJeremy L Thompson
33446d1b5SJeremy L Thompsonon:
43446d1b5SJeremy L Thompson  push:
5dcd9f19cSJeremy L Thompson    branches:
6dcd9f19cSJeremy L Thompson      - main
7dcd9f19cSJeremy L Thompson  pull_request:
83446d1b5SJeremy L Thompson
93446d1b5SJeremy L Thompsonjobs:
103446d1b5SJeremy L Thompson  test:
113446d1b5SJeremy L Thompson    strategy:
123446d1b5SJeremy L Thompson      matrix:
138ddf3821SJeremy L Thompson        os: [ubuntu-24.04, macos-15]
14ed1ebff7SJeremy L Thompson        compiler: [gcc, clang]
15eb5e7f26SHugh Carson        include:
16eb5e7f26SHugh Carson          - os: macos-15
17*94ab23f8SHugh Carson            compiler: apple-clang
183446d1b5SJeremy L Thompson
193446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
203446d1b5SJeremy L Thompson
213446d1b5SJeremy L Thompson    steps:
223446d1b5SJeremy L Thompson    - name: Environment setup
23e735508cSJeremy L Thompson      uses: actions/checkout@v4
24eb5e7f26SHugh Carson    - name: Set compiler
25*94ab23f8SHugh Carson      run: |
26*94ab23f8SHugh Carson        case "${{ matrix.compiler }}" in
27*94ab23f8SHugh Carson          gcc)
28*94ab23f8SHugh Carson            if [[ "${{ matrix.os }}" == macos-* ]]; then
29*94ab23f8SHugh Carson              echo "CC=gcc-15" >> $GITHUB_ENV
30*94ab23f8SHugh Carson            else
31*94ab23f8SHugh Carson              echo "CC=gcc" >> $GITHUB_ENV
32*94ab23f8SHugh Carson            fi
33*94ab23f8SHugh Carson            ;;
34*94ab23f8SHugh Carson          clang)
35*94ab23f8SHugh Carson            if [[ "${{ matrix.os }}" == macos-* ]]; then
36*94ab23f8SHugh Carson              echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV
37*94ab23f8SHugh Carson            else
38*94ab23f8SHugh Carson              echo "CC=clang" >> $GITHUB_ENV
39*94ab23f8SHugh Carson            fi
40*94ab23f8SHugh Carson            ;;
41*94ab23f8SHugh Carson          apple-clang)
42*94ab23f8SHugh Carson            echo "CC=clang" >> $GITHUB_ENV
43*94ab23f8SHugh Carson            ;;
44*94ab23f8SHugh Carson        esac
45eb5e7f26SHugh Carson    - name: Show compiler version
46eb5e7f26SHugh Carson      run: $CC --version | head -1
473446d1b5SJeremy L Thompson    - name: Build and test libCEED
483446d1b5SJeremy L Thompson      env:
49ed1ebff7SJeremy L Thompson        FC: gfortran-14
503446d1b5SJeremy L Thompson      run: |
513446d1b5SJeremy L Thompson        make info
52d402b6f8SJeremy L Thompson        make -j
5344bedce4SJeremy L Thompson        make prove -j2
54