Scheduled NEURON CI #1663
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scheduled NEURON CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
# Run at 2am every day | |
- cron: '0 2 * * *' | |
workflow_dispatch: | |
inputs: | |
azure_drop_url: | |
description: 'Azure drop (artifacts) url' | |
neuron_branch: | |
description: 'NEURON branch to test' | |
default: '' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
ci: | |
timeout-minutes: 45 | |
runs-on: ${{ matrix.os.vm }} | |
container: ${{ matrix.os.container }} | |
name: "blabla" | |
env: | |
OS_FLAVOUR: ${{matrix.os.flavour}} | |
UNPRIVILEGED_USER: runner # User created+used inside Docker containers | |
# Extra software collections to be installed and enabled on CentOS7 | |
SOFTWARE_COLLECTIONS_centos_7: devtoolset-9 rh-git218 rh-python38 | |
strategy: | |
matrix: | |
os: | |
# Ubuntu Latest (22.04, at time of writing) Docker image | |
- { vm: ubuntu-latest, container: "ubuntu:latest", flavour: debian } | |
fail-fast: false | |
steps: | |
# Checkout the dedicated repository that steers the CI build | |
- uses: actions/checkout@v3 | |
# Install required packages using the system package manager. This | |
# includes installing or updating the git client to a sufficiently | |
# new version that the checkout of the main nrn repository does *not* | |
# fall back to using the REST API, which clobbers submodule information | |
# and breaks the build. | |
- name: Install ${{matrix.os.flavour}} packages | |
run: | | |
OS_CONTAINER="${{matrix.os.container}}" | |
# only the part after the last slash | |
OS_CONTAINER="${OS_CONTAINER##*/}" | |
# replace : and . with _ | |
OS_CONTAINER="${OS_CONTAINER//[:.]/_}" | |
CONTAINER_SCRIPT="scripts/install_${{matrix.os.flavour}}_${OS_CONTAINER}.sh" | |
# pass this on to the next steps too, for convenience | |
echo "OS_CONTAINER=${OS_CONTAINER}" >> "${GITHUB_ENV}" | |
# (container+flavour)-specific script runs first because it must be | |
# able to enable repositories that make the flavour-specific script | |
# work. | |
if [ -f "${CONTAINER_SCRIPT}" ]; then source "${CONTAINER_SCRIPT}"; fi | |
if [ -f "${FLAVOUR_SCRIPT}" ]; then source "${FLAVOUR_SCRIPT}"; fi | |
env: | |
FLAVOUR_SCRIPT: scripts/install_${{matrix.os.flavour}}.sh | |
# Checkout the repository; do this before the privilege step so that we | |
# can chown the result there | |
- name: Checkout NEURON | |
working-directory: ${{github.workspace}} | |
run: | | |
branch_or_tag="${{matrix.branch_or_tag_and_default_wheel.branch_or_tag}}" | |
echo "branch_or_tag=${branch_or_tag}" | |
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 --recursive | |
python -m venv env | |
source env/bin/activate | |
env/bin/python -m pip install neuron-nightly pytest | |
env/bin/python -m pytest -k test_multi_gridding_mix |