1- name : Py 3.8, 3.9 | Windows Mac Linux
1+ name : Py 3.8, 3.9, 3.10, 3.11 | Windows Mac Linux
22
33on :
44 push :
1010 - master
1111 - develop
1212jobs :
13+ set-os :
14+ runs-on : ubuntu-latest
15+ outputs :
16+ matrix_os : ${{ steps.set-matrix.outputs.matrix_os }}
17+ steps :
18+ - id : set-matrix
19+ run : |
20+ if [[ "${{ github.base_ref }}" == "develop" ]]; then
21+ echo "matrix_os=[\"ubuntu-latest\"]" >> $GITHUB_OUTPUT
22+ else
23+ echo "matrix_os=[\"windows-latest\", \"ubuntu-latest\", \"macos-latest\"]" >> $GITHUB_OUTPUT
24+ fi
25+
1326 check-changes :
1427 runs-on : ubuntu-latest
1528 outputs :
1629 wave_io_hindcast_changed : ${{ steps.changes.outputs.wave_io_hindcast }}
1730 should-run-hindcast : ${{ steps.hindcast-logic.outputs.should-run-hindcast }}
1831 steps :
1932 - name : Checkout code
20- uses : actions/checkout@v2
33+ uses : actions/checkout@v3
2134
2235 - name : Check for changes in wave/io/hindcast
2336 id : changes
3043 - id : hindcast-logic
3144 run : |
3245 if [[ "${{ github.event.pull_request.base.ref }}" == "master" || "${{ steps.changes.outputs.wave_io_hindcast }}" == "true" ]]; then
33- echo "::set-output name= should-run-hindcast:: true"
46+ echo "should-run-hindcast= true" >> "$GITHUB_OUTPUT "
3447 else
35- echo "::set-output name= should-run-hindcast:: false"
48+ echo "should-run-hindcast= false" >> "$GITHUB_OUTPUT "
3649 fi
3750
3851 prepare-cache :
4255 PYTHON_VER : 3.9
4356 steps :
4457 - name : Checkout code
45- uses : actions/checkout@v2
58+ uses : actions/checkout@v3
4659
4760 - name : Setup Conda
4861 uses : s-weigand/setup-conda@v1
@@ -81,25 +94,25 @@ jobs:
8194 pytest mhkit/tests/wave/io/hindcast/test_wind_toolkit.py
8295
8396 - name : Upload data as artifact
84- uses : actions/upload-artifact@v2
97+ uses : actions/upload-artifact@v3
8598 with :
8699 name : data
87100 path : ~/.cache/mhkit
88101
89102 conda-build :
90103 name : conda-${{ matrix.os }}/${{ matrix.python-version }}
91- needs : [prepare-cache]
104+ needs : [set-os, prepare-cache]
92105 runs-on : ${{ matrix.os }}
93106 strategy :
94107 fail-fast : false
95108 matrix :
96- os : ["windows-latest", "ubuntu-latest", "macos-latest"]
97- python-version : [3.8, 3.9]
109+ os : ${{fromJson(needs.set-os.outputs.matrix_os)}}
110+ python-version : [" 3.8", " 3.9", "3.10", "3.11" ]
98111 env :
99112 PYTHON_VER : ${{ matrix.python-version }}
100113
101114 steps :
102- - uses : actions/checkout@v2
115+ - uses : actions/checkout@v3
103116
104117 - name : Setup Conda
105118 uses : s-weigand/setup-conda@v1
@@ -123,7 +136,7 @@ jobs:
123136 pip install coverage pytest coveralls .
124137
125138 - name : Download data from artifact
126- uses : actions/download-artifact@v2
139+ uses : actions/download-artifact@v3
127140 with :
128141 name : data
129142 path : ~/.cache/mhkit
@@ -146,27 +159,27 @@ jobs:
146159
147160 pip-build :
148161 name : pip-${{ matrix.os }}/${{ matrix.python-version }}
149- needs : [prepare-cache]
162+ needs : [set-os, prepare-cache]
150163 runs-on : ${{ matrix.os }}
151164 strategy :
152165 fail-fast : false
153166 matrix :
154- os : ["windows-latest", "ubuntu-latest", "macos-latest"]
155- python-version : [3.8, 3.9]
167+ os : ${{fromJson(needs.set-os.outputs.matrix_os)}}
168+ python-version : [" 3.8", " 3.9", "3.10", "3.11" ]
156169
157170 steps :
158171 - uses : conda-incubator/setup-miniconda@v2
159172
160173 - name : Set up Python ${{ matrix.python-version }}
161- uses : actions/setup-python@v2
174+ uses : actions/setup-python@v3
162175 with :
163176 python-version : ${{ matrix.python-version }}
164177
165178 - name : Set up Git repository
166- uses : actions/checkout@v2
179+ uses : actions/checkout@v3
167180
168181 - name : Download data from artifact
169- uses : actions/download-artifact@v2
182+ uses : actions/download-artifact@v3
170183 with :
171184 name : data
172185 path : ~/.cache/mhkit
@@ -189,19 +202,19 @@ jobs:
189202
190203 hindcast-calls :
191204 name : hindcast-${{ matrix.os }}/${{ matrix.python-version }}
192- needs : [check-changes, prepare-cache]
205+ needs : [check-changes, prepare-cache, set-os ]
193206 if : (needs.check-changes.outputs.should-run-hindcast == 'true')
194207
195208 runs-on : ${{ matrix.os }}
196209 strategy :
197210 max-parallel : 1
198211 fail-fast : false
199212 matrix :
200- os : ["windows-latest", "macos-latest", "ubuntu-latest"]
201- python-version : [3.8, 3.9]
213+ os : ${{fromJson(needs.set-os.outputs.matrix_os)}}
214+ python-version : [3.8, 3.9, 3.10, 3.11 ]
202215
203216 steps :
204- - uses : actions/checkout@v2
217+ - uses : actions/checkout@v3
205218
206219 - name : Setup Conda
207220 uses : s-weigand/setup-conda@v1
@@ -218,7 +231,7 @@ jobs:
218231 pip install -e . --no-deps --force-reinstall
219232
220233 - name : Download data from artifact
221- uses : actions/download-artifact@v2
234+ uses : actions/download-artifact@v3
222235 with :
223236 name : data
224237 path : ~/.cache/mhkit
0 commit comments