This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
183 lines (165 loc) · 7.64 KB
/
continuous-integration.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
name: continuous-integration
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
linux-ci:
runs-on: ubuntu-18.04
continue-on-error: false
strategy:
fail-fast: true
matrix:
include:
- CC: clang-7
CXX: clang++-7
PYTHON_VERSION: '3.6'
BUILD_TYPE: 'RelWithDebInfo'
PACKAGES: 'clang-7 build-essential libmpich-dev mpich ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared static --python --mpi --gotcha --stats --tools mallocp mpip --cxx-standard=17'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON -DTIMEMORY_UNITY_BUILD=OFF -DTIMEMORY_BUILD_PYTHON_UNITY=OFF'
- CC: clang-8
CXX: clang++-8
PYTHON_VERSION: '3.6'
BUILD_TYPE: 'RelWithDebInfo'
PACKAGES: 'clang-8 build-essential ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared static --stats --tools kokkos-config timem --cxx-standard=14'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON'
- CC: clang-9
CXX: clang++-9
PYTHON_VERSION: '3.7'
BUILD_TYPE: 'MinSizeRel'
PACKAGES: 'clang-9 build-essential libopenmpi-dev openmpi-bin openmpi-common libfabric-dev ccache graphviz'
BUILD_ARGS: '--quick --build-libs shared --mpi --gotcha --tools mallocp mpip ompt --cxx-standard=14'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON'
- CC: gcc-6
CXX: g++-6
FC: gfortran-6
PYTHON_VERSION: '3.6'
BUILD_TYPE: 'RelWithDebInfo'
PACKAGES: 'gcc-6 g++-6 gfortran-6 build-essential libtbb-dev ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared --python --arch --extra-optimizations --caliper --cxx-standard=14'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON -DTIMEMORY_BUILD_PYTHON_UNITY=OFF'
- CC: gcc-7
CXX: g++-7
FC: gfortran-7
PYTHON_VERSION: '3.7'
BUILD_TYPE: 'Debug'
PACKAGES: 'gcc-7 g++-7 gfortran-7 build-essential libmpich-dev mpich libtbb-dev libpapi-dev papi-tools lcov ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared --mpi --papi --gotcha --tools mpip --stats --cxx-standard=17 --coverage'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: ''
- CC: gcc-8
CXX: g++-8
FC: gfortran-8
PYTHON_VERSION: '3.7'
BUILD_TYPE: 'Release'
PACKAGES: 'gcc-8 g++-8 gfortran-8 build-essential libmpich-dev mpich ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared --mpi --gotcha --stats --tools compiler --cxx-standard=17'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON'
- CC: gcc-9
CXX: g++-9
FC: gfortran-9
PYTHON_VERSION: '3.7'
BUILD_TYPE: 'MinSizeRel'
PACKAGES: 'gcc-9 g++-9 gfortran-9 build-essential ccache graphviz'
BUILD_ARGS: '--minimal --build-libs shared --gotcha --stats --python --cxx-standard=17'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_CCACHE_BUILD=ON -DTIMEMORY_BUILD_PYTHON_UNITY=OFF'
env:
CC: ${{ matrix.CC }}
FC: ${{ matrix.FC }}
CXX: ${{ matrix.CXX }}
CTEST_ARGS: "${{ matrix.CTEST_ARGS }}"
steps:
- name: Setup Environment
run: |
echo "PATH=${HOME}/miniconda/bin:${PATH}" >> $GITHUB_ENV
echo "CMAKE_ARGS=-DCMAKE_INSTALL_PREFIX=${HOME}/timemory-install -DTIMEMORY_SOCKET_TESTS=OFF ${{ matrix.CONFIG_ARGS }}" >> $GITHUB_ENV
echo "PYCTEST_ARGS=-SF --pyctest-model=Continuous --pyctest-site=GitHub -j 1 --compile-time-perf ${HOME}/ctp -cc ${{ matrix.CC }} -cxx ${{ matrix.CXX }} --pyctest-build-type=${{ matrix.BUILD_TYPE }} ${{ matrix.BUILD_ARGS }}" >> $GITHUB_ENV
env | sort
- name: Checkout Code
uses: actions/checkout@v2
with:
clean: true
- name: Update container
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.PACKAGES }}
sudo scripts/linux-ci.sh
- name: Install PyCTest
run: |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p ${HOME}/miniconda
conda config --set always_yes yes --set changeps1 no
conda create -c conda-forge -c defaults -n pyctest python=${{ matrix.PYTHON_VERSION }} pyctest
- name: Install Requirements
run: |
source activate
conda activate pyctest
python -m pip install -r requirements.txt
python -m pip install pytest
- name: Build and Test
run: |
source activate
conda activate pyctest
echo -e "Running command:\n$(which python) ./pyctest-runner.py ${PYCTEST_ARGS} -- ${CTEST_ARGS} -- ${CMAKE_ARGS}"
python ./pyctest-runner.py ${PYCTEST_ARGS} -- ${CTEST_ARGS} -- ${CMAKE_ARGS}
- name: Update Log
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
for i in $(find Testing | grep LastUpdate); do echo "##### File: ${i} #####"; cat ${i}; done
- name: Configure Log
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
for i in $(find Testing | grep LastConfigure); do echo "##### File: ${i} #####"; cat ${i}; done
- name: Build Log
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
for i in $(find Testing | grep LastBuild); do echo "##### File: ${i} #####"; cat ${i}; done
- name: Test Log
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
for i in $(find Testing | grep LastTest); do echo "##### File: ${i} #####"; cat ${i}; done
- name: Validate Build
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
source activate
conda activate pyctest
cmake --build . --target all --parallel $(nproc)
- name: Test Install
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
source activate
conda activate pyctest
cmake --build . --target install --parallel $(nproc)
- name: Test Python Build
if: ${{ matrix.BUILD_TYPE != 'Debug' }}
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
source activate
conda activate pyctest
if [ -f "tests/test-python-install-import.cmake" ]; then
cmake -P tests/test-python-install-import.cmake;
PYTHONPATH=. $(which pytest) -s;
fi
- name: Import Python Install
working-directory: ${{github.workspace}}/build-timemory/Linux
run: |
source activate
conda activate pyctest
if [ -f "tests/test-python-install-import.cmake" ]; then
cd;
export PYTHONPATH="${HOME}/timemory-install/lib/python${{ matrix.PYTHON_VERSION }}/site-packages:${PYTHONPATH}"
python -c "import timemory; print(timemory.__file__)";
fi
- name: Test Examples
working-directory: ${{github.workspace}}/examples
run: |
cmake -B build-examples -DTIMEMORY_BUILD_C_EXAMPLES=ON -Dtimemory_DIR=${HOME}/timemory-install/share/cmake/timemory .
cmake --build build-examples --target ex_array_of_bundles --parallel 2