|
38 | 38 |
|
39 | 39 | steps: |
40 | 40 | - 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 |
41 | 73 |
|
42 | 74 | - name: Set up Python ${{ matrix.python-version }} |
43 | 75 | uses: actions/setup-python@v2 |
@@ -78,22 +110,39 @@ jobs: |
78 | 110 | - name: Run Models with NEURON V1 -> ${{ env.NEURON_V1 }} |
79 | 111 | run: | |
80 | 112 | # 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 |
82 | 118 | nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"` |
83 | 119 | runmodels --virtual $nrn_ver $MODELS_TO_RUN |
84 | 120 | 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 | + |
86 | 127 | echo "nrn1_ver=$nrn_ver" >> $GITHUB_ENV |
87 | 128 |
|
88 | 129 | - name: Run Models with NEURON V2 -> ${{ env.NEURON_V2 }} |
89 | 130 | if: env.NEURON_V1 != env.NEURON_V2 |
90 | 131 | run: | |
91 | 132 | # 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 |
93 | 138 | nrn_ver=`python -c "from neuron import __version__ as nrn_ver; print(nrn_ver)"` |
94 | 139 | runmodels --virtual $nrn_ver $MODELS_TO_RUN |
95 | 140 | 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 |
97 | 146 | echo "nrn2_ver=$nrn_ver" >> $GITHUB_ENV |
98 | 147 |
|
99 | 148 | - name: diffreports2html ${{ env.nrn1_ver }}.json <-> ${{ env.nrn2_ver }}.json |
|
0 commit comments