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