|
| 1 | +name: CMake |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - try-github-actions |
| 8 | + paths: |
| 9 | + - .github/workflows/cmake.yml |
| 10 | + - '**CMakeLists.txt' |
| 11 | + - 'BLAS' |
| 12 | + - 'CBLAS' |
| 13 | + - 'CMAKE' |
| 14 | + - 'INSTALL' |
| 15 | + - 'LAPACKE' |
| 16 | + - 'SRC' |
| 17 | + - 'TESTING' |
| 18 | + - '!**README' |
| 19 | + - '!**Makefile' |
| 20 | + - '!**md' |
| 21 | + pull_request: |
| 22 | + paths: |
| 23 | + - .github/workflows/cmake.yml |
| 24 | + - '**CMakeLists.txt' |
| 25 | + - 'BLAS' |
| 26 | + - 'CBLAS' |
| 27 | + - 'CMAKE' |
| 28 | + - 'INSTALL' |
| 29 | + - 'LAPACKE' |
| 30 | + - 'SRC' |
| 31 | + - 'TESTING' |
| 32 | + - '!**README' |
| 33 | + - '!**Makefile' |
| 34 | + - '!**md' |
| 35 | + |
| 36 | +env: |
| 37 | + CFLAGS: "-Wall -pedantic" |
| 38 | + FFLAGS: "-fimplicit-none -frecursive -fcheck=all" |
| 39 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 40 | + |
| 41 | +defaults: |
| 42 | + run: |
| 43 | + shell: bash |
| 44 | + |
| 45 | +jobs: |
| 46 | + |
| 47 | + test-install-release: |
| 48 | + # Use GNU compilers |
| 49 | + |
| 50 | + # The CMake configure and build commands are platform agnostic and should work equally |
| 51 | + # well on Windows or Mac. You can convert this to a matrix build if you need |
| 52 | + # cross-platform coverage. |
| 53 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 54 | + runs-on: ${{ matrix.os }} |
| 55 | + |
| 56 | + env: |
| 57 | + BUILD_TYPE: Release |
| 58 | + |
| 59 | + strategy: |
| 60 | + fail-fast: true |
| 61 | + matrix: |
| 62 | + os: [ macos-latest, ubuntu-latest ] |
| 63 | + |
| 64 | + steps: |
| 65 | + |
| 66 | + - name: Checkout LAPACK |
| 67 | + uses: actions/checkout@v2 |
| 68 | + |
| 69 | + - name: Use GCC-11 on MacOS |
| 70 | + if: ${{ matrix.os == 'macos-latest' }} |
| 71 | + run: > |
| 72 | + cmake -B build |
| 73 | + -D CMAKE_C_COMPILER="gcc-11" |
| 74 | + -D CMAKE_Fortran_COMPILER="gfortran-11" |
| 75 | +
|
| 76 | + # - name: Use Unix Makefiles on Windows |
| 77 | + # if: ${{ matrix.os == 'windows-latest' }} |
| 78 | + # run: > |
| 79 | + # cmake -B build |
| 80 | + # -G "Unix Makefiles" |
| 81 | + # -D CMAKE_C_FLAGS="${{env.CFLAGS}} -Wl,--stack=1000000000" |
| 82 | + |
| 83 | + - name: Configure CMake |
| 84 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 85 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 86 | + run: > |
| 87 | + cmake -B build |
| 88 | + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 89 | + -D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install |
| 90 | + -D CBLAS:BOOL=ON |
| 91 | + -D LAPACKE:BOOL=ON |
| 92 | + -D BUILD_TESTING:BOOL=ON |
| 93 | + -D LAPACKE_WITH_TMG:BOOL=ON |
| 94 | + -D BUILD_SHARED_LIBS:BOOL=ON |
| 95 | +
|
| 96 | + - name: CTest |
| 97 | + working-directory: ${{github.workspace}}/build |
| 98 | + # Execute tests defined by the CMake configuration. |
| 99 | + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
| 100 | + run: | |
| 101 | + ctest -D ExperimentalStart |
| 102 | + ctest -D ExperimentalConfigure |
| 103 | + ctest -D ExperimentalBuild -j2 |
| 104 | + ctest -D ExperimentalTest --schedule-random -j2 --output-on-failure --timeout 100 |
| 105 | + ctest -D ExperimentalSubmit |
| 106 | +
|
| 107 | + - name: Install |
| 108 | + run: cmake --build build --target install -j2 |
| 109 | + |
| 110 | + coverage: |
| 111 | + runs-on: ubuntu-latest |
| 112 | + env: |
| 113 | + BUILD_TYPE: Coverage |
| 114 | + steps: |
| 115 | + |
| 116 | + - name: Checkout LAPACK |
| 117 | + uses: actions/checkout@v2 |
| 118 | + |
| 119 | + - name: Configure CMake |
| 120 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 121 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 122 | + run: > |
| 123 | + cmake -B build |
| 124 | + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 125 | + -D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install |
| 126 | + -D CBLAS:BOOL=ON |
| 127 | + -D LAPACKE:BOOL=ON |
| 128 | + -D BUILD_TESTING:BOOL=ON |
| 129 | + -D LAPACKE_WITH_TMG:BOOL=ON |
| 130 | + -D BUILD_SHARED_LIBS:BOOL=ON |
| 131 | +
|
| 132 | + - name: Install |
| 133 | + run: cmake --build build --target install -j2 |
| 134 | + |
| 135 | + - name: Coverage |
| 136 | + run: | |
| 137 | + echo "Coverage" |
| 138 | + cmake --build build --target coverage |
| 139 | + bash <(curl -s https://codecov.io/bash) -X gcov |
0 commit comments