xref: /libCEED/.github/workflows/c-fortran-test-linux-osx.yml (revision eb5e7f265ad4bea76490efa023163fbf9f3d6c69)
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]
15*eb5e7f26SHugh Carson        exclude:
16*eb5e7f26SHugh Carson          # "gcc" on macOS is a symlink to Apple Clang, same as "clang"
17*eb5e7f26SHugh Carson          - os: macos-15
18*eb5e7f26SHugh Carson            compiler: gcc
19*eb5e7f26SHugh Carson        include:
20*eb5e7f26SHugh Carson          # macOS: test with real GCC (not Apple Clang symlink)
21*eb5e7f26SHugh Carson          - os: macos-15
22*eb5e7f26SHugh Carson            compiler: gcc-15
23*eb5e7f26SHugh Carson          # macOS: test with Homebrew LLVM
24*eb5e7f26SHugh Carson          - os: macos-15
25*eb5e7f26SHugh Carson            compiler: llvm
263446d1b5SJeremy L Thompson
273446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
283446d1b5SJeremy L Thompson
293446d1b5SJeremy L Thompson    steps:
303446d1b5SJeremy L Thompson    - name: Environment setup
31e735508cSJeremy L Thompson      uses: actions/checkout@v4
32*eb5e7f26SHugh Carson    - name: Set LLVM compiler path
33*eb5e7f26SHugh Carson      if: matrix.compiler == 'llvm'
34*eb5e7f26SHugh Carson      run: echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV
35*eb5e7f26SHugh Carson    - name: Set compiler
36*eb5e7f26SHugh Carson      if: matrix.compiler != 'llvm'
37*eb5e7f26SHugh Carson      run: echo "CC=${{ matrix.compiler }}" >> $GITHUB_ENV
38*eb5e7f26SHugh Carson    - name: Show compiler version
39*eb5e7f26SHugh Carson      run: $CC --version | head -1
403446d1b5SJeremy L Thompson    - name: Build and test libCEED
413446d1b5SJeremy L Thompson      env:
42ed1ebff7SJeremy L Thompson        FC: gfortran-14
433446d1b5SJeremy L Thompson      run: |
443446d1b5SJeremy L Thompson        make info
45d402b6f8SJeremy L Thompson        make -j
4644bedce4SJeremy L Thompson        make prove -j2
47