Skip to content

Commit df08368

Browse files
add support for Azure drop URL (#16)
1 parent 1ef2a89 commit df08368

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

.github/workflows/nrn-modeldb-ci.yaml

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,38 @@ jobs:
3838

3939
steps:
4040
- uses: actions/checkout@v2
41+
42+
- name: check for Azure drop NEURON_V1 -> ${{ github.event.inputs.neuron_v1 }}
43+
if: github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.neuron_v1, 'https://dev.azure.com/neuronsimulator/')
44+
run: |
45+
# check URI
46+
curl -sfSI -X GET '${{ github.event.inputs.neuron_v1 }}'
47+
48+
# Download Azure drop and unzip
49+
AZURE_DROP_URL="$NEURON_V1"
50+
rm -rf drop
51+
wget --tries=4 -LO DROP_V1.zip ${AZURE_DROP_URL}
52+
unzip DROP_V1.zip
53+
mv drop DROP_V1
54+
55+
# Set drop dir in the env
56+
echo "DROP_DIR_V1=`pwd`/DROP_V1" >> $GITHUB_ENV
57+
58+
- name: check for Azure drop NEURON_V2 -> ${{ github.event.inputs.neuron_v2 }}
59+
if: github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.neuron_v2, 'https://dev.azure.com/neuronsimulator/')
60+
run: |
61+
# check URI
62+
curl -sfSI -X GET '${{ github.event.inputs.neuron_v2 }}'
63+
64+
# Download Azure drop and unzip
65+
AZURE_DROP_URL="$NEURON_V2"
66+
rm -rf drop
67+
wget --tries=4 -LO DROP_V2.zip ${AZURE_DROP_URL}
68+
unzip DROP_V2.zip
69+
mv drop DROP_V2
70+
71+
# Set drop dir in the env
72+
echo "DROP_DIR_V2=`pwd`/DROP_V2" >> $GITHUB_ENV
4173
4274
- name: Set up Python ${{ matrix.python-version }}
4375
uses: actions/setup-python@v2
@@ -78,22 +110,39 @@ jobs:
78110
- name: Run Models with NEURON V1 -> ${{ env.NEURON_V1 }}
79111
run: |
80112
# Install NEURON V1
81-
python -m pip install $NEURON_V1
113+
if [[ -d "${DROP_DIR_V1}" ]]; then
114+
python -m pip install --user --find-links ${DROP_DIR_V1} neuron-nightly
115+
else
116+
python -m pip install $NEURON_V1
117+
fi
82118
nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"`
83119
runmodels --virtual $nrn_ver $MODELS_TO_RUN
84120
report2html ${nrn_ver}.json
85-
python -m pip uninstall --yes $NEURON_V1
121+
if [[ -d "${DROP_DIR_V1}" ]]; then
122+
python -m pip uninstall --yes neuron-nightly==${nrn_ver}
123+
else
124+
python -m pip uninstall --yes $NEURON_V1
125+
fi
126+
86127
echo "nrn1_ver=$nrn_ver" >> $GITHUB_ENV
87128
88129
- name: Run Models with NEURON V2 -> ${{ env.NEURON_V2 }}
89130
if: env.NEURON_V1 != env.NEURON_V2
90131
run: |
91132
# Install NEURON V2
92-
python -m pip install $NEURON_V2
133+
if [[ -d "${DROP_DIR_V2}" ]]; then
134+
python -m pip install --user --find-links ${DROP_DIR_V2} neuron-nightly
135+
else
136+
python -m pip install $NEURON_V2
137+
fi
93138
nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"`
94139
runmodels --virtual $nrn_ver $MODELS_TO_RUN
95140
report2html ${nrn_ver}.json
96-
python -m pip uninstall --yes $NEURON_V2
141+
if [[ -d "${DROP_DIR_V2}" ]]; then
142+
python -m pip uninstall --yes neuron-nightly==${nrn_ver}
143+
else
144+
python -m pip uninstall --yes $NEURON_V2
145+
fi
97146
echo "nrn2_ver=$nrn_ver" >> $GITHUB_ENV
98147
99148
- name: diffreports2html ${{ env.nrn1_ver }}.json <-> ${{ env.nrn2_ver }}.json

0 commit comments

Comments
 (0)