-
Notifications
You must be signed in to change notification settings - Fork 23
157 lines (139 loc) · 4.94 KB
/
CI.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
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
schedule:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * *"
jobs:
unix:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux CPU CUDA 11.0 Python 3.6
python-version: "3.6"
os: ubuntu-latest
gcc-version: "9"
cuda-version: "11.0"
cdt-name: cos7 # CentOS sysroot: cuda 10.x needs cos6, 11+ needs cos7
CMAKE_FLAGS: |
-DPLUMED_BUILD_CUDA_LIB=ON \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
-DEXTRA_COMPILE_FLAGS="-L/usr/local/cuda/lib64/stubs -Wl,-rpath,/usr/local/cuda/lib64/stubs -Wl,-rpath-link,/usr/local/cuda/lib64/stubs"
- name: MacOS Intel CPU OpenCL Python 3.9
python-version: "3.9"
os: macos-latest
cuda-version: ""
CMAKE_FLAGS: ""
steps:
- uses: actions/checkout@v2
- name: "Patch conda env (if needed)"
if: startsWith(matrix.os, 'ubuntu')
run: |
sed -i -e "s/@CDT_NAME@/${{ matrix.cdt-name }}/g" \
-e "s/@GCC_VERSION@/${{ matrix.gcc-version }}.*/g" \
-e "s/@CUDATOOLKIT_VERSION@/${{ matrix.cuda-version }}.*/g" \
devtools/conda-envs/build-${{ matrix.os }}.yml
- uses: conda-incubator/setup-miniconda@v2
name: "Prepare base dependencies"
with:
python-version: ${{ matrix.python-version }}
activate-environment: build
environment-file: devtools/conda-envs/build-${{ matrix.os }}.yml
auto-activate-base: false
channels: conda-forge
- name: "Install CUDA on Ubuntu (if needed)"
if: matrix.cuda-version != ''
env:
CUDA_VERSION: ${{ matrix.cuda-version }}
run: source devtools/scripts/install_cuda.sh
- name: "Set SDK on MacOS (if needed)"
if: startsWith(matrix.os, 'macos')
run: source devtools/scripts/install_macos_sdk.sh
- name: "Conda info"
shell: bash -l {0}
run: |
conda info -a
conda list
- name: Patch Plumed's Lepton location
shell: bash -l {0}
run: |
test -d ${CONDA_PREFIX}/include/plumed/lepton && mv ${CONDA_PREFIX}/include/plumed/lepton ${CONDA_PREFIX}/include/plumed/lepton.bak
- name: "Configure build with CMake"
shell: bash -l {0}
run: |
mkdir build
cd build
SHLIB_EXT=".so"
if [[ ${{ matrix.os }} == macos-* ]]; then
SHLIB_EXT=".dylib"
fi
cmake .. \
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DOPENMM_DIR=${CONDA_PREFIX} \
-DPLUMED_INCLUDE_DIR=${CONDA_PREFIX}/include/plumed \
-DPLUMED_LIBRARY_DIR=${CONDA_PREFIX}/lib \
-DPLUMED_BUILD_OPENCL_LIB=ON \
-DOPENCL_INCLUDE_DIR=${CONDA_PREFIX}/include \
-DOPENCL_LIBRARY=${CONDA_PREFIX}/lib/libOpenCL${SHLIB_EXT} \
${{ matrix.CMAKE_FLAGS }}
- name: "Build"
shell: bash -l {0}
run: |
cd build
make -j2 install
make -j2 PythonInstall
- name: "Plugin information"
shell: bash -l {0}
run: |
python -c "import simtk.openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')"
- name: "Test C++"
shell: bash -l {0}
run: |
set +e
cd build
if [[ ${{ matrix.os }} == ubuntu-* ]]; then
test_files=$(find . -name "Test*" -executable -type f)
else
test_files=$(find . -name "Test*" -perm +0111 -type f)
fi
summary=""
exitcode=0
for f in $test_files; do
fn=$(basename $f)
echo "::group::$fn"
summary+="\n${fn}: "
if [[ $fn == *Cuda* ]]; then
echo "Skipping $fn..."
summary+="Skipped"
echo "::endgroup::"
continue
fi
echo "Running $fn..."
./${f}
thisexitcode=$?
if [[ $thisexitcode == 0 ]]; then summary+="OK"; else summary+="FAILED"; fi
((exitcode+=$thisexitcode))
echo "::endgroup::"
done
echo "-------"
echo "Summary"
echo "-------"
echo -e "${summary}"
exit $exitcode
- name: "Test Python"
shell: bash -l {0}
run: |
cd python/tests
pytest -v Test*