-
Notifications
You must be signed in to change notification settings - Fork 17
213 lines (190 loc) · 7.92 KB
/
build_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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: CI Build
# Triggers on push and branches on the master
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
RUNNER_ENV : github_runner
RUNNER_SPACK_BRANCH : e4s-23.08
CC : gcc
FC : gfortran
CXX : g++
# Allows to run this workflow manually from the Actions tab
#workflow_dispatch:
jobs:
debug:
runs-on: [self-hosted, Linux]
strategy:
fail-fast: false
matrix:
build_type : [ Debug ]
shared_type : [ OFF, ON ]
profiling : [ ON ]
name: "Type=${{ matrix.build_type }} shared=${{ matrix.shared_type }} profiling=${{matrix.profiling}}"
env:
BUILD_DIRECTORY : "${{github.workspace}}/build/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
INSTALL_DIRECTORY : "${{github.workspace}}/install/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
BUILD_CONFIG : >
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPARSEC_DEBUG_NOISIER=ON
-DPARSEC_DEBUG_PARANOID=ON
-DBUILD_SHARED_LIBS=${{ matrix.shared_type }}
-DPARSEC_PROF_TRACE=${{ matrix.profiling }}
-DMPIEXEC_PREFLAGS='--bind-to;none;--oversubscribe'
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIRECTORY
steps:
- uses: actions/checkout@v2
- name: Setup Build Environment ${{ runner.os }}
id: setup
# Create a separate build directory and use it for all subsequent commands
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
spack compiler list
cmake -E make_directory ${{ env.BUILD_DIRECTORY }}
- name: Configure CMake
id: configure
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
echo CC=gcc CXX=g++ FC=gfortran cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_CONFIG
CC=gcc CXX=g++ FC=gfortran cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_CONFIG
- name: Build
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
cmake --build .
- name: Install
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 2
shell: bash
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
cmake --build . --target install
- name: Test
if: ${{ startsWith(matrix.build_type, 'Release') }}
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C $BUILD_TYPE
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
ctest --output-on-failure
- name: Save Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: CMake-error-log
path: ${{ env.BUILD_DIRECTORY }}/CMakeFiles/CMakeError.log
release:
needs: debug
runs-on: [self-hosted, Linux]
strategy:
fail-fast: false
matrix:
build_type : [ Release ]
shared_type : [ ON ]
profiling : [ OFF, ON ]
name: "Type=${{ matrix.build_type }} shared=${{ matrix.shared_type }} profiling=${{matrix.profiling}}"
env:
BUILD_DIRECTORY : "${{github.workspace}}/build/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
INSTALL_DIRECTORY : "${{github.workspace}}/install/${{ matrix.build_type }}/shared_${{matrix.shared_type}}/profile_${{matrix.profiling}}"
BUILD_CONFIG : >
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DPARSEC_DEBUG_NOISIER=OFF
-DBUILD_SHARED_LIBS=${{ matrix.shared_type }}
-DPARSEC_PROF_TRACE=${{ matrix.profiling }}
-DMPIEXEC_PREFLAGS='--bind-to;none;--oversubscribe'
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIRECTORY
steps:
- uses: actions/checkout@v2
- name: Check PR updates Flex/Bison Archive iff .y/.l modified
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
# Check if .l/.y files have been modified without corresponding update with `cmake --build . --target parsec_pregen_flex_bison`
if [[ `git --version | cut -d " " -f 3` > "2.0" ]]; then
# Make sure we fetch the branch we want to compare with
git fetch origin ${{ github.base_ref }}
git diff --name-only --diff-filter=AMRD origin/${{ github.base_ref }} -- contrib/pregen_flex_bison.tar '*.[ly]' | awk '/pregen_flex_bison.tar/{t=1} /.[ly]/{s=1} END{if(t-s) exit 1}'
fi
- name: Setup Build Environment ${{ runner.os }}
id: setup
# Create a separate build directory and use it for all subsequent commands
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
spack compiler list
cmake -E make_directory ${{ env.BUILD_DIRECTORY }}
- name: Configure CMake
id: configure
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_CONFIG
- name: Build
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
cmake --build .
- name: Install
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 10
shell: bash
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
cmake --build . --target install
- name: Save Build Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: CMake-error-log
path: ${{ env.BUILD_DIRECTORY }}/CMakeFiles/CMakeError.log
- name: Test
# Disable the tests for now
if: ${{ startsWith(matrix.build_type, 'Release') }}
working-directory: ${{ env.BUILD_DIRECTORY }}
timeout-minutes: 20
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C $BUILD_TYPE
run: |
source ${{github.workspace}}/.github/CI/spack_setup.sh
# enable devices only in tests that explicitely require them
PARSEC_MCA_device_cuda_enabled=0
PARSEC_MCA_device_hip_enabled=0
# restrict memory use for oversubscribed runners
PARSEC_MCA_device_cuda_memory_use=10
PARSEC_MCA_device_hip_memory_use=10
ctest --output-on-failure
- name: Save Testing Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: LastTest_log
path: ${{ env.BUILD_DIRECTORY }}/Testing/Temporary/LastTest.log