consolidate CI and json #265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| env: | |
| HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
| on: | |
| push: | |
| paths: | |
| - "**.f90" | |
| - "**.F90" | |
| - "**.c" | |
| - "**.cpp" | |
| - "**.h" | |
| - "**.cmake" | |
| - "**/CMakeLists.txt" | |
| - ".github/workflows/ci.yml" | |
| workflow_dispatch: | |
| # avoid wasted runs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux-gcc: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| gcc-version: [12, 13, 14] | |
| env: | |
| CC: gcc-${{ matrix.gcc-version }} | |
| CXX: g++-${{ matrix.gcc-version }} | |
| FC: gfortran-${{ matrix.gcc-version }} | |
| steps: | |
| - &checkout | |
| uses: actions/checkout@v6 | |
| - uses: ./.github/workflows/composite-unix | |
| linux-gcc-old: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| gcc-version: [9, 10, 11] | |
| env: &gcc-env | |
| CC: gcc-${{ matrix.gcc-version }} | |
| CXX: g++-${{ matrix.gcc-version }} | |
| FC: gfortran-${{ matrix.gcc-version }} | |
| steps: | |
| - *checkout | |
| - name: GCC APT | |
| if: matrix.gcc-version < 10 | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y --no-install-recommends gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} gfortran-${{ matrix.gcc-version }} | |
| - &default-workflow | |
| run: cmake --workflow default | |
| gcc-7-8: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:20.04 | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| gcc-version: [8] | |
| cmake_version: [4.3.2] | |
| # GCC 7 works, but just didn't feel the need to test so old a version | |
| env: *gcc-env | |
| steps: | |
| - name: install compilers | |
| run: | | |
| apt update -y | |
| apt install -y --no-install-recommends ca-certificates gpg curl make ${{ env.CC }} ${{ env.CXX }} ${{ env.FC }} | |
| - name: install CMake | |
| run: | | |
| curl -LO "https://github.com/Kitware/CMake/releases/download/v${{ matrix.cmake_version }}/cmake-${{ matrix.cmake_version }}-linux-x86_64.tar.gz" | |
| tar -xf cmake-${{ matrix.cmake_version }}-linux-x86_64.tar.gz --exclude=doc/ --exclude=man/ --exclude=Help/ | |
| echo "CMAKE=$GITHUB_WORKSPACE/cmake-${{ matrix.cmake_version }}-linux-x86_64/bin/cmake" >> $GITHUB_ENV | |
| - *checkout | |
| - run: $CMAKE --workflow gmake | |
| valgrind-memory: | |
| runs-on: ubuntu-latest | |
| needs: linux-gcc | |
| timeout-minutes: 10 | |
| steps: | |
| - name: install valgrind | |
| run: | | |
| sudo apt update | |
| sudo apt install --no-install-recommends valgrind | |
| - *checkout | |
| - run: ctest -S memcheck.cmake -VV -E "sleep|string_array|string_view|binding_derived" | |
| # just saving CI time | |
| # linux-flang: | |
| # runs-on: ubuntu-latest | |
| # timeout-minutes: 15 | |
| # strategy: | |
| # matrix: | |
| # llvm-version: [21] | |
| # steps: | |
| # - *checkout | |
| # - name: Apt LLVM | |
| # run: | | |
| # wget https://apt.llvm.org/llvm.sh | |
| # chmod +x llvm.sh | |
| # sudo ./llvm.sh ${{ matrix.llvm-version }} | |
| # sudo apt-get update | |
| # - name: install Flang | |
| # run: sudo apt install --no-install-recommends clang-${{ matrix.llvm-version }} flang-${{ matrix.llvm-version }} | |
| # # MUST specify version here or default old Clang used despite LLVM apt docs | |
| # - uses: ./.github/workflows/composite-unix | |
| # env: | |
| # CC: clang-${{ matrix.llvm-version }} | |
| # CXX: clang++-${{ matrix.llvm-version }} | |
| # FC: flang-${{ matrix.llvm-version }} | |
| mac: | |
| runs-on: macos-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| compiler: [{cpp: clang++, c: clang, fc: flang-new }, | |
| {cpp: clang++, c: clang, fc: gfortran-15 }, | |
| {cpp: g++-15, c: gcc-15, fc: gfortran-15 }] | |
| env: | |
| FC: ${{ matrix.compiler.fc }} | |
| CC: ${{ matrix.compiler.c }} | |
| CXX: ${{ matrix.compiler.cpp }} | |
| name: macOS ${{ matrix.compiler.cpp }} ${{ matrix.compiler.fc }} | |
| steps: | |
| - name: install Flang | |
| if: ${{ matrix.compiler.fc == 'flang-new' }} | |
| run: brew install flang | |
| - *checkout | |
| - uses: ./.github/workflows/composite-unix | |
| windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 10 | |
| env: | |
| CC: gcc | |
| CXX: g++ | |
| FC: gfortran | |
| steps: | |
| - uses: msys2/setup-msys2@v2 | |
| id: msys2 | |
| with: | |
| update: true | |
| install: mingw-w64-ucrt-x86_64-gcc-fortran | |
| - name: Put MSYS2_MinGW64 on PATH | |
| run: echo "${{ steps.msys2.outputs.msys2-location }}/ucrt64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - *checkout | |
| - run: cmake --workflow default | |
| - name: upload CMakeConfigureLog.yaml | |
| if: failure() && hashFiles('build/CMakeFiles/CMakeConfigureLog.yaml') != '' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ runner.os }}-CMakeConfigureLog.yaml | |
| path: build/CMakeFiles/CMakeConfigureLog.yaml |