Format CMake files with cmake-format
#1468
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: [development, main] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'INSTALL.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: [development, main] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'INSTALL.md' | |
| - 'docs/**' | |
| workflow_dispatch: | |
| inputs: | |
| debug_enabled: | |
| type: boolean | |
| description: 'Run the build with tmate debugging enabled' | |
| required: false | |
| default: true | |
| jobs: | |
| run: | |
| strategy: | |
| matrix: | |
| include: | |
| - name: "[Ubuntu] CMake + gcc" | |
| os: ubuntu-latest | |
| cmakeWorkflowPreset: gnu-default | |
| - name: "[Ubuntu] CMake + clang" | |
| os: ubuntu-latest | |
| cmakeWorkflowPreset: clang-default | |
| - name: "[Ubuntu] CMake + Intel/LLVM" | |
| os: ubuntu-latest | |
| cmakeWorkflowPreset: oneapi-default | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup tmate session | |
| uses: mxschmitt/[email protected] | |
| if: ${{ inputs.debug_enabled }} | |
| - name: Set OCCA install directory | |
| run: echo "OCCA_INSTALL_DIR=${PWD}/install" >> ${GITHUB_ENV} | |
| - name: add oneAPI to apt | |
| if: ${{ matrix.cmakeWorkflowPreset == 'oneapi-default' }} | |
| shell: bash | |
| run: | | |
| cd /tmp | |
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | |
| - name: install oneAPI dpcpp compiler | |
| if: ${{ matrix.cmakeWorkflowPreset == 'oneapi-default' }} | |
| shell: bash | |
| run: | | |
| sudo apt update | |
| sudo apt install intel-oneapi-compiler-dpcpp-cpp | |
| sudo apt install intel-oneapi-compiler-fortran | |
| - name: CMake configure, build, install and test | |
| if: ${{ matrix.cmakeWorkflowPreset }} | |
| run: | | |
| if [[ "${{ matrix.cmakeWorkflowPreset }}" == "oneapi-default" ]]; then | |
| source /opt/intel/oneapi/setvars.sh | |
| fi | |
| cmake --workflow --preset ${{ matrix.cmakeWorkflowPreset }} | |
| - name: CMake build examples as an independent project | |
| if: ${{ matrix.useCMake && !matrix.useoneAPI}} | |
| run: | | |
| export OCCA_DIR=${OCCA_INSTALL_DIR} | |
| cd examples | |
| cmake -S . -B build | |
| - name: CMake build tests as an independent project | |
| if: ${{ matrix.useCMake && !matrix.useoneAPI}} | |
| run: | | |
| export OCCA_DIR=${OCCA_INSTALL_DIR} | |
| cd tests | |
| cmake -S . -B build | |
| - name: Upload code coverage | |
| if: ${{ matrix.OCCA_COVERAGE }} | |
| run: bash <(curl --no-buffer -s https://codecov.io/bash) -x "${GCOV}" | |
| - name: Block to allow inspecting failures | |
| run: sleep 1800 | |
| if: ${{ failure() && inputs.debug_enabled }} |