@@ -262,6 +262,9 @@ jobs:
262262 - name : Build SNOPT
263263 if : matrix.PYOPTSPARSE_FROM != 'build_pyoptsparse' && matrix.SNOPT
264264 continue-on-error : false
265+ env :
266+ SNOPT_LOCATION : ${{ secrets.SNOPT_LOCATION }}
267+ SNOPT_VERSION : ${{ matrix.SNOPT }}
265268 run : |
266269 echo "============================================================="
267270 echo "Build SNOPT library"
@@ -270,9 +273,7 @@ jobs:
270273 echo "-------------------------------------------------------------"
271274 echo "Getting SNOPT source"
272275 echo "-------------------------------------------------------------"
273- scp -qr ${{ secrets.SNOPT_LOCATION }} .
274- elif [[ "${{ matrix.SNOPT }}" ]]; then
275- echo "SNOPT version ${{ matrix.SNOPT }} was requested but source is not available"
276+ .github/actions/install_pyoptsparse/download_snopt.sh
276277 fi
277278
278279 if [ -d "SNOPT" ] ; then
@@ -332,6 +333,9 @@ jobs:
332333 - name : Install pyOptSparse using build_pyoptsparse
333334 if : matrix.PYOPTSPARSE && matrix.PYOPTSPARSE_FROM == 'build_pyoptsparse'
334335 continue-on-error : false
336+ env :
337+ SNOPT_LOCATION : ${{ secrets.SNOPT_LOCATION }}
338+ SNOPT_VERSION : ${{ matrix.SNOPT }}
335339 run : |
336340 conda install -c conda-forge swig -q -y
337341
@@ -353,16 +357,13 @@ jobs:
353357 PAROPT="-a"
354358 fi
355359
356- if [[ "${{ matrix.SNOPT }}" == "7.7" && "${{ secrets.SNOPT_LOCATION_77 }}" ]]; then
360+ if [[ "${{ matrix.SNOPT }}" == "7.7" ]]; then
357361 echo " > Secure copying SNOPT 7.7 over SSH"
358- mkdir SNOPT
359- scp -qr ${{ secrets.SNOPT_LOCATION_77 }} SNOPT
362+ .github/actions/install_pyoptsparse/download_snopt.sh
360363 SNOPT="-s SNOPT/src"
361- elif [[ "${{ matrix.SNOPT }}" == "7.2" && "${{ secrets.SNOPT_LOCATION_72 }}" ]]; then
364+ elif [[ "${{ matrix.SNOPT }}" == "7.2" ]]; then
362365 echo " > Secure copying SNOPT 7.2 over SSH"
363- mkdir SNOPT
364- scp -qr ${{ secrets.SNOPT_LOCATION_72 }} SNOPT
365- ls -lR SNOPT
366+ .github/actions/install_pyoptsparse/download_snopt.sh
366367 SNOPT="-s SNOPT/source"
367368 elif [[ "${{ matrix.SNOPT }}" ]]; then
368369 echo "SNOPT version ${{ matrix.SNOPT }} was requested but source is not available"
0 commit comments