|
| 1 | +name: build-test-analyze |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ main ] |
| 5 | + pull_request: |
| 6 | + branches: [ main ] |
| 7 | + schedule: |
| 8 | + - cron: '23 14 * * 3' |
| 9 | + |
| 10 | +jobs: |
| 11 | + buildTestAnalyze: |
| 12 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + compiler: [g++,clang++] |
| 17 | + language: ['cpp'] |
| 18 | + build_type: [Debug, Release] |
| 19 | + # Permissions needed for codeql analysis |
| 20 | + # I think this is the minimal set needed for a public repo (https://github.com/github/codeql-action/pull/689). |
| 21 | + permissions: |
| 22 | + security-events: write |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Install CMake |
| 26 | + run: | |
| 27 | + sudo apt-get update -yq |
| 28 | + sudo apt-get install -yq cmake |
| 29 | + cmake --version |
| 30 | +
|
| 31 | + ## Kokkos |
| 32 | + - name: Kokkos Checkout repo |
| 33 | + uses: actions/checkout@v2 |
| 34 | + with: |
| 35 | + repository: kokkos/kokkos |
| 36 | + path: kokkos |
| 37 | + |
| 38 | + - name: Kokkos Configure CMake |
| 39 | + shell: bash |
| 40 | + run: cmake -S $GITHUB_WORKSPACE/kokkos -B ${{runner.workspace}}/build-kokkos |
| 41 | + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} |
| 42 | + -DKokkos_ENABLE_SERIAL=ON |
| 43 | + -DKokkos_ENABLE_OPENMP=OFF |
| 44 | + -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-kokkos/install |
| 45 | + |
| 46 | + - name: Kokkos Build |
| 47 | + shell: bash |
| 48 | + run: cmake --build ${{runner.workspace}}/build-kokkos --parallel 2 --target install |
| 49 | + |
| 50 | + ## Omegah |
| 51 | + - name: Omega_h Checkout repo |
| 52 | + uses: actions/checkout@v2 |
| 53 | + with: |
| 54 | + repository: sandialabs/omega_h |
| 55 | + path: omegah |
| 56 | + |
| 57 | + - name: Omega_h Configure CMake |
| 58 | + shell: bash |
| 59 | + run: cmake -S $GITHUB_WORKSPACE/omegah -B ${{runner.workspace}}/build-omegah |
| 60 | + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} |
| 61 | + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} |
| 62 | + -DBUILD_SHARED_LIBS=OFF |
| 63 | + -DOmega_h_USE_Kokkos=ON |
| 64 | + -DKokkos_PREFIX=${{runner.workspace}}/build-kokkos/install/lib64/cmake |
| 65 | + -DOmega_h_USE_MPI=OFF |
| 66 | + -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-omegah/install |
| 67 | + |
| 68 | + - name: Omega_h Build |
| 69 | + shell: bash |
| 70 | + run: cmake --build ${{runner.workspace}}/build-omegah --parallel 2 --target install |
| 71 | + |
| 72 | + ## Cabana |
| 73 | + - name: Cabana Checkout repo |
| 74 | + uses: actions/checkout@v2 |
| 75 | + with: |
| 76 | + repository: ECP-copa/Cabana |
| 77 | + path: cabana |
| 78 | + |
| 79 | + - name: Cabana Configure CMake |
| 80 | + shell: bash |
| 81 | + run: cmake -S $GITHUB_WORKSPACE/cabana -B ${{runner.workspace}}/build-cabana |
| 82 | + -DCMAKE_CXX_COMPILER=${{matrix.compiler}} |
| 83 | + -DCabana_ENABLE_MPI=OFF |
| 84 | + -DCabana_ENABLE_CAJITA=OFF |
| 85 | + -DCabana_ENABLE_TESTING=OFF |
| 86 | + -DCabana_ENABLE_EXAMPLES=OFF |
| 87 | + -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-cabana/install |
| 88 | + |
| 89 | + - name: Cabana Build |
| 90 | + shell: bash |
| 91 | + run: cmake --build ${{runner.workspace}}/build-cabana --parallel 2 --target install |
| 92 | + |
| 93 | + ## MeshFields |
| 94 | + - name: MeshFields Checkout repo |
| 95 | + uses: actions/checkout@v2 |
| 96 | + with: |
| 97 | + repository: SCOREC/meshFields |
| 98 | + path: meshFields |
| 99 | + |
| 100 | + - name: MeshFields Configure CMake |
| 101 | + shell: bash |
| 102 | + run: cmake -S $GITHUB_WORKSPACE/meshFields -B ${{runner.workspace}}/build-meshFields |
| 103 | + -DCMAKE_CXX_COMPILER=${{matrix.compiler}} |
| 104 | + -DKokkos_DIR=${{runner.workspace}}/build-kokkos/install/lib64/cmake |
| 105 | + -DCabana_DIR=${{runner.workspace}}/build-cabana/install/ |
| 106 | + -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/build-meshFields/install |
| 107 | + |
| 108 | + # Initializes the CodeQL tools for scanning. This must be done before the code is built. |
| 109 | + - name: Initialize CodeQL |
| 110 | + uses: github/codeql-action/init@v2 |
| 111 | + with: |
| 112 | + languages: ${{ matrix.language }} |
| 113 | + queries: security-and-quality |
| 114 | + source-root: meshFields |
| 115 | + |
| 116 | + - name: MeshFields Build |
| 117 | + shell: bash |
| 118 | + run: cmake --build ${{runner.workspace}}/build-meshFields --parallel 2 --target install |
| 119 | + |
| 120 | + - name: MeshFields Test |
| 121 | + working-directory: ${{runner.workspace}}/build-meshFields |
| 122 | + shell: bash |
| 123 | + run: ctest --timeout 10 --output-on-failure |
| 124 | + |
| 125 | + - name: Perform CodeQL Analysis |
| 126 | + uses: github/codeql-action/analyze@v2 |
0 commit comments