2121 additional_options :
2222 required : true
2323 type : string
24+ interface :
25+ required : true
26+ type : string
27+ python_version :
28+ required : false
29+ type : string
2430env :
2531 ISSM_DIR : ${{ github.workspace }}
2632
3844 uses : actions/cache@v3
3945 id : cache-externalpackages
4046 env :
41- cache-name : cache-externalpackages-${{ inputs.build_type }}
47+ cache-name : cache-externalpackages-${{ inputs.build_type}}
4248 with :
4349 path : |
4450 ${{ env.ISSM_DIR }}/externalpackages/
@@ -51,15 +57,34 @@ jobs:
5157 ${{ inputs.ext_install_command }}
5258
5359 - name : Get MATLAB
60+ if : ${{inputs.interface == 'matlab'}}
5461 id : setup-matlab
5562 uses : matlab-actions/setup-matlab@v2
5663 with :
5764 release : R2023b
5865 cache : true
5966
67+ - name : Prepare python
68+ if : contains( inputs.interface, 'python')
69+ uses : actions/setup-python@v5
70+ id : setup-python
71+ with :
72+ python-version : ${{ inputs.python_version }}
73+
74+ - name : Install dependencies
75+ if : contains( inputs.interface, 'python')
76+ run : |
77+ sudo apt-get install libpython${{ inputs.python_version }}-dev
78+ sudo apt-get install python3-dev
79+ python -m pip install --upgrade pip
80+ sudo apt-get update && sudo apt-get install -y python-tk python3-tk
81+ python -m pip install numpy scipy matplotlib nose
82+
6083 - name : build ISSM
6184 run : |
6285 export MATLAB_ROOT=${{ steps.setup-matlab.outputs.matlabroot }}
86+ export PYTHON_ROOT=${{ env.pythonLocation }}
87+ export NUMPY_ROOT=${{ env.LD_LIBRARY_PATH }}/python3.11/site-packages/numpy
6388 ${{ inputs.build_command}}
6489
6590 - name : Compile ISSM
@@ -99,13 +124,15 @@ jobs:
99124 shell : ' bash'
100125
101126 - name : Get MATLAB
127+ if : ${{inputs.interface == 'matlab'}}
102128 id : setup-matlab
103129 uses : matlab-actions/setup-matlab@v2
104130 with :
105131 release : R2023b
106132 cache : true
107133
108134 - name : Creating matlab_ci.m
135+ if : ${{inputs.interface == 'matlab'}}
109136 run : |
110137 cat > ${ISSM_DIR}/matlab_ci.m << EOF
111138 % Go to the test directory
@@ -122,11 +149,37 @@ jobs:
122149 cat ${ISSM_DIR}/matlab_ci.m
123150
124151 - name : Get run-matlab-command
152+ if : ${{inputs.interface == 'matlab'}}
125153 run : |
126154 wget -O /usr/local/bin/run-matlab-command https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/glnxa64/run-matlab-command
127155 chmod +x /usr/local/bin/run-matlab-command
128156
129157 - name : Run MATLAB tests
158+ if : ${{inputs.interface == 'matlab'}}
130159 run : |
131160 source $ISSM_DIR/etc/environment.sh
132161 LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$ISSM_DIR/externalpackages/petsc/install/lib/libmpi.so:$ISSM_DIR/externalpackages/petsc/install/lib/libmpifort.so run-matlab-command "matlab_ci"
162+
163+ - name : Prepare python
164+ if : contains( inputs.interface, 'python')
165+ uses : actions/setup-python@v5
166+ id : setup-python
167+ with :
168+ python-version : ${{ inputs.python_version }}
169+
170+ - name : Install dependencies
171+ if : contains( inputs.interface, 'python')
172+ run : |
173+ python -m pip install --upgrade pip
174+ sudo apt-get update && sudo apt-get install -y python-tk python3-tk
175+ python -m pip install numpy scipy matplotlib nose netCDF4
176+
177+ - name : Run Python tests
178+ if : contains( inputs.interface, 'python')
179+ run : |
180+ export PYTHONPATH="${ISSM_DIR}/src/m/dev:${PYTHONPATH}"
181+ export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
182+ export PYTHONUNBUFFERED=1
183+ source $ISSM_DIR/etc/environment.sh
184+ cd $ISSM_DIR/test/NightlyRun
185+ LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$ISSM_DIR/externalpackages/petsc/install/lib/libmpi.so:$ISSM_DIR/externalpackages/petsc/install/lib/libmpifort.so ./runme.py --output=nightly --rank=1 --numprocs=1 --id {{matrix.test_cases}} --exclude Dakota 234 418 420
0 commit comments