Skip to content

Commit

Permalink
Various CI fixes (#62)
Browse files Browse the repository at this point in the history
* Use the requirement files for installation of python packages
* Use ci_requirements.txt only if it exists
* Install also the required python packages for NMODL
* Use MacOS 13 instead of 11
* Make sure that setuptools are installed for Python12 support
* Recursively initialize submodules to include mod2c in macos-13
* Run CI on PRs on non-Mondays
* Test latest release only on pushes to main and any PR
* Add workaround for Brew packages

---------

Co-authored-by: Goran Jelic-Cizmek <[email protected]>
  • Loading branch information
iomaganaris and JCGoran authored Mar 19, 2024
1 parent b346dd9 commit 96b8c0b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build-neuron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Scheduled NEURON CI

on:
push:
branches:
- main
pull_request:
schedule:
# Run at 2am every day
- cron: '0 2 * * *'
Expand Down Expand Up @@ -44,9 +47,10 @@ jobs:
then
# If we're not told to test a specific branch, test the default branch with neuron-nightly wheels
values="{\"branch_or_tag\": \"\", \"default_wheel\": \"neuron-nightly\"}"
if [[ $(date +%u) == 1 ]]
if [[ $(date +%u) == 1 ]] || [[ ${{ github.event_name }} == 'pull_request' ]] || [[ ${{ github.event_name }} == 'push' ]]
then
# If it's a Monday, test the latest release (and latest released wheels) in addition
# Also test it on any PR, and any push to a PR
tag_name="${{steps.get_latest_release.outputs.tag_name}}"
values="${values}, {\"branch_or_tag\": \"${tag_name}\", \"default_wheel\": \"neuron==${tag_name}\"}"
fi
Expand Down Expand Up @@ -74,10 +78,10 @@ jobs:
strategy:
matrix:
os:
# GitHub Actions MacOS 13 runner
- { vm: macos-13, flavour: macOS }
# GitHub Actions MacOS 12 runner
- { vm: macos-12, flavour: macOS }
# GitHub Actions MacOS 11 runner
- { vm: macos-11, flavour: macOS }
# CentOS7 Docker image
- { vm: ubuntu-latest, container: "centos:7", flavour: redhat }
# CentOS Stream 8 Docker image
Expand Down Expand Up @@ -136,7 +140,7 @@ jobs:
if [ -n "${branch_or_tag}" ]; then BRANCH_OPT="--branch=${branch_or_tag}"; fi
git clone --depth=1 --single-branch ${BRANCH_OPT} ${{github.server_url}}/${{github.repository_owner}}/nrn
# Init submodules for testing purposes
cd nrn && git submodule update --init
cd nrn && git submodule update --init --recursive
# When we run in Ubuntu/Fedora/Debian containers from Docker Hub then we
# are root. This is different from when we use the GitHub Actions images
Expand Down
13 changes: 11 additions & 2 deletions scripts/buildNeuron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ export PYTHON=$(command -v python)
export PYTHONPATH=$(${PYTHON} -c 'import site; print(":".join(site.getsitepackages()))')

# Install extra dependencies for NEURON into the virtual environment.
pip install --upgrade bokeh "cython<3" ipython matplotlib mpi4py numpy pytest \
pytest-cov scikit-build sympy
pip install --upgrade -r nrn_requirements.txt
if [[ -f ci_requirements.txt ]]; then
pip install --upgrade -r ci_requirements.txt
else
pip install --upgrade plotly "ipywidgets>=7.0.0"
fi
if [[ -f external/nmodl/requirements.txt ]]; then
pip install --upgrade -r external/nmodl/requirements.txt
fi
# Needed for installation of older NEURON versions with Python 12
pip install --upgrade setuptools

# Set default compilers, but don't override preset values
export CC=${CC:-gcc}
Expand Down
3 changes: 3 additions & 0 deletions scripts/install_macOS.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
set -eux
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
brew install bison boost coreutils flex mpich ninja xz wget
brew unlink mpich
brew install openmpi
Expand Down

0 comments on commit 96b8c0b

Please sign in to comment.