This repository was archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
168 lines (147 loc) · 6.41 KB
/
coreneuron-ci.yml
File metadata and controls
168 lines (147 loc) · 6.41 KB
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
name: CoreNEURON CI
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
env:
BUILD_TYPE: Release
DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer
DEFAULT_PY_VERSION: 3.8
jobs:
ci:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - ${{ toJson(matrix.config) }})
env:
INSTALL_DIR: install
SDK_ROOT: $(xcrun --sdk macosx --show-sdk-path)
strategy:
matrix:
os: [ ubuntu-18.04, macOS-10.15 ]
config:
# Defaults: CORENRN_ENABLE_MPI=ON
- {cmake_option: "-DCORENRN_ENABLE_DEBUG_CODE=ON -DTEST_EXEC_PREFIX='mpiexec;-n;2'", documentation: ON}
- {cmake_option: "-DCORENRN_ENABLE_MPI_DYNAMIC=ON -DTEST_EXEC_PREFIX='mpiexec;-n;2'"}
- {cmake_option: "-DCORENRN_ENABLE_MPI_DYNAMIC=ON -DCORENRN_ENABLE_SHARED=OFF -DTEST_EXEC_PREFIX='mpiexec;-n;2'"}
- {cmake_option: "-DCORENRN_ENABLE_MPI=OFF"}
- {use_nmodl: ON, py_version: 3.6.7}
- {use_nmodl: ON}
- {use_ispc: ON, py_version: 3.6.7}
- {gcc_version: 9}
fail-fast: false
steps:
- name: Install homebrew packages
if: startsWith(matrix.os, 'macOS')
run: |
brew update
brew install coreutils bison flex boost openmpi
shell: bash
- name: Install apt packages
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install doxygen bison flex libboost-all-dev libopenmpi-dev openmpi-bin python3-dev python3-pip libfl-dev
shell: bash
- name: Install specific apt packages
if: startsWith(matrix.os, 'ubuntu') && matrix.config.gcc_version
run: |
sudo apt-get install g++-${GCC_VERSION}
shell: bash
env:
GCC_VERSION: ${{ matrix.config.gcc_version }}
- name: Set up Python3
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
env:
PYTHON_VERSION: ${{ matrix.config.py_version || env.DEFAULT_PY_VERSION }}
- name: Install ISPC
if: ${{ matrix.config.use_ispc == 'ON' }}
working-directory: ${{runner.workspace}}
run: |
ispc_version="v1.12.0";
if [ "${{ startsWith(matrix.os, 'ubuntu') }}" == "true" ]; then
url_os="linux";
ispc_version_suffix="b";
else
url_os="macOS";
ispc_version_suffix="";
fi;
url="https://github.com/ispc/ispc/releases/download/${ispc_version}/ispc-${ispc_version}${ispc_version_suffix}-${url_os}.tar.gz";
wget -O ispc.tar.gz $url;
mkdir ispc && tar -xvzf ispc.tar.gz -C ispc --strip 1;
- name: Install NMODL dependencies
if: ${{ matrix.config.use_nmodl == 'ON' || matrix.config.use_ispc == 'ON' }}
run: |
python3 -m pip install --upgrade pip jinja2 pyyaml pytest "sympy<1.6";
- uses: actions/checkout@v2
- name: Install Python3 documentation dependencies
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.config.documentation == 'ON' }}
working-directory: ${{runner.workspace}}/CoreNeuron
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade -r docs/docs_requirements.txt
- name: Build and Test
id: build-test
shell: bash
working-directory: ${{runner.workspace}}/CoreNeuron
run: |
if [ -n "$GCC_VERSION" ]; then
export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}";
fi
if [[ "${{ startsWith(matrix.os, 'macOS') }}" = "true" ]]; then
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH;
export CXX=g++;
export CC=gcc;
fi
echo "------- Build, Test and Install -------"
mkdir build && cd build
if [[ "$USE_ISPC" == "ON" ]]; then
cmake -DCORENRN_ENABLE_ISPC=ON -DCMAKE_ISPC_COMPILER=${{runner.workspace}}/ispc/bin/ispc -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DPYTHON_EXECUTABLE=$(which python3) ..;
elif [[ "$USE_NMODL" == "ON" ]]; then
cmake -DCORENRN_ENABLE_NMODL=ON -DCORENRN_NMODL_FLAGS="sympy --analytic" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DPYTHON_EXECUTABLE=$(which python3) ..;
else
cmake ${cmake_option} -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DPYTHON_EXECUTABLE=$(which python3) ..;
fi
make
ctest --output-on-failure
make install
env:
cmake_option: ${{ matrix.config.cmake_option }}
USE_ISPC: ${{ matrix.config.use_ispc }}
USE_NMODL: ${{ matrix.config.use_nmodl }}
INSTALL_DIR: ${{ runner.workspace }}/install
GCC_VERSION: ${{ matrix.config.gcc_version }}
PYTHON_VERSION: ${{ matrix.config.py_version || env.DEFAULT_PY_VERSION }}
# This step will set up an SSH connection on tmate.io for live debugging.
# To enable it, you have to:
# * add 'live-debug-ci' to your PR title
# * push something to your PR branch (note that just re-running the pipeline disregards the title update)
- name: live debug session on failure (manual steps required, check `.github/workflows/coreneuron-ci.yml`)
if: failure() && contains(github.event.pull_request.title, 'live-debug-ci')
uses: mxschmitt/action-tmate@v3
- name: Documentation
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.config.documentation == 'ON' }}
id: documentation
working-directory: ${{runner.workspace}}/CoreNeuron
run: |
echo "------- Build Doxygen Documentation -------";
pushd build;
make docs;
echo "-------- Disable jekyll --------";
pushd docs;
touch .nojekyll;
echo ::set-output name=status::done
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
if: steps.documentation.outputs.status == 'done' && github.ref == 'refs/heads/master'
with:
branch: gh-pages # The branch the action should deploy to.
folder: ${{runner.workspace}}/CoreNeuron/build/docs # The folder the action should deploy.
single-commit: true #have a single commit on the deployment branch instead of maintaining the full history