|
| 1 | +name: oneapi-linux |
| 2 | + |
| 3 | +env: |
| 4 | + CC: icx |
| 5 | + CXX: icpx |
| 6 | + FC: ifx |
| 7 | + LINUX_CPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp |
| 8 | + LINUX_FORTRAN_COMPONENTS: intel-oneapi-compiler-fortran |
| 9 | + LINUX_MKL_COMPONENTS: intel-oneapi-mkl intel-oneapi-mkl-devel |
| 10 | + LINUX_MPI_COMPONENTS: intel-oneapi-mpi intel-oneapi-mpi-devel |
| 11 | +# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml |
| 12 | + CTEST_NO_TESTS_ACTION: error |
| 13 | + CMAKE_BUILD_PARALLEL_LEVEL: 4 |
| 14 | + CMAKE_BUILD_TYPE: Release |
| 15 | + CTEST_PARALLEL_LEVEL: 0 |
| 16 | + # oneAPI Debug triggers asan errors on Linux in general on any project |
| 17 | + CMAKE_INSTALL_PREFIX: ~/libs |
| 18 | + CMAKE_PREFIX_PATH: ~/libs |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + paths: |
| 23 | + - "**.c" |
| 24 | + - "**.cpp" |
| 25 | + - "**.f90" |
| 26 | + - "**.F90" |
| 27 | + - "**.cmake" |
| 28 | + - "cmake/libraries.json" |
| 29 | + - "CMakePresets.json" |
| 30 | + - "**/CMakeLists.txt" |
| 31 | + - "!cmake/gnu.cmake" |
| 32 | + - ".github/workflows/oneapi-linux.yml" |
| 33 | +# paths ignore starting with "!" |
| 34 | + - "!docs/**" |
| 35 | + - "!**/cray.cmake" |
| 36 | + workflow_dispatch: |
| 37 | + |
| 38 | +# avoid wasted runs |
| 39 | +concurrency: |
| 40 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 41 | + cancel-in-progress: true |
| 42 | + |
| 43 | + |
| 44 | +jobs: |
| 45 | + |
| 46 | + linux: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + timeout-minutes: 15 |
| 49 | + |
| 50 | + steps: |
| 51 | + |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + # this must be before oneAPI script commands else the scripts do not exist on the image |
| 54 | + |
| 55 | + - name: cache install oneAPI |
| 56 | + id: cache-install |
| 57 | + uses: actions/cache@v4 |
| 58 | + with: |
| 59 | + path: | |
| 60 | + /opt/intel/oneapi |
| 61 | + key: oneapi-apt |
| 62 | + |
| 63 | + - name: non-cache install oneAPI |
| 64 | + if: steps.cache-install.outputs.cache-hit != 'true' |
| 65 | + timeout-minutes: 8 |
| 66 | + # 5 minutes times out sometimes |
| 67 | + run: | |
| 68 | + sh -c .github/workflows/oneapi_setup_apt_repo_linux.sh |
| 69 | + sudo apt install --no-install-recommends ${{ env.LINUX_FORTRAN_COMPONENTS }} ${{ env.LINUX_CPP_COMPONENTS }} ${{ env.LINUX_MPI_COMPONENTS }} |
| 70 | +
|
| 71 | + - name: Setup Intel oneAPI environment |
| 72 | + run: | |
| 73 | + source /opt/intel/oneapi/setvars.sh |
| 74 | + printenv >> $GITHUB_ENV |
| 75 | +
|
| 76 | + - name: CMake Configure |
| 77 | + run: cmake --preset default -G Ninja |
| 78 | + |
| 79 | + - name: print config log |
| 80 | + if: ${{ failure() }} |
| 81 | + run: cat build/CMakeFiles/CMakeConfigureLog.yaml |
| 82 | + |
| 83 | + - name: build |
| 84 | + run: cmake --build --preset default |
| 85 | + |
| 86 | + - name: build failed |
| 87 | + if: ${{ failure() }} |
| 88 | + run: cmake --build --preset default -j1 -v |
| 89 | + |
| 90 | + - name: unit test |
| 91 | + run: ctest --preset default -L unit |
| 92 | + |
| 93 | + # - name: RELEASE build |
| 94 | + # run: cmake --build --preset release |
| 95 | + # - name: RELEASE unit test |
| 96 | + # run: ctest --preset release -L unit |
| 97 | + # - name: RELEASE test core |
| 98 | + # run: ctest --preset release -LE unit -E 3d |
| 99 | + |
| 100 | + - name: exclude unused files from cache |
| 101 | + if: steps.cache-install.outputs.cache-hit != 'true' |
| 102 | + run: .github/workflows/oneapi_cache_exclude_linux.sh |
0 commit comments