1313 default : ' ubuntu-latest'
1414 cygwin :
1515 description : >
16- Whether Cygwin should be used on Windows (empty if not), and
17- how ('waiter' will sleep 1 hour if the cache is not
18- initialized when it starts, 'initializer' will assume it has
19- the role of creating that cache)
20- type : string
21- default : ' '
16+ Whether Cygwin should be used on Windows
17+ type : boolean
18+ default : false
2219 timeout :
2320 description : ' Timeout'
2421 type : number
@@ -129,7 +126,7 @@ jobs:
129126 # Cygwin case
130127 echo OPAMYES=1 >> $env:GITHUB_ENV
131128 echo OPAMROOT=/cygdrive/d/opam >> $env:GITHUB_ENV
132- if : " runner.os == 'Windows' && inputs.cygwin != '' "
129+ if : " runner.os == 'Windows' && inputs.cygwin"
133130
134131 - name : Checkout code
135132 uses : actions/checkout@v2
@@ -224,7 +221,7 @@ jobs:
224221 upstream: https://github.com/ocaml/opam-repository.git
225222 opam-depext : false
226223 cache-prefix : ${{ steps.presetup.outputs.cache_prefix }}
227- if : " runner.os == 'Windows' && inputs.cygwin == '' "
224+ if : " runner.os == 'Windows' && ! inputs.cygwin"
228225
229226 - name : Restore Cygwin packages (Cygwin)
230227 uses : actions/cache/restore@v3
@@ -235,14 +232,14 @@ jobs:
235232 path : |
236233 C:\cygwin-packages
237234 key : cygwin-packages-opam-2.0.7-1
238- if : " runner.os == 'Windows' && inputs.cygwin != '' "
235+ if : " runner.os == 'Windows' && inputs.cygwin"
239236
240237 - name : Install Cygwin (in particular OPAM) (Cygwin)
241238 uses : cygwin/cygwin-install-action@v3
242239 with :
243240 packages : opam
244241 install-dir : ' D:\cygwin'
245- if : " runner.os == 'Windows' && inputs.cygwin != '' "
242+ if : " runner.os == 'Windows' && inputs.cygwin"
246243
247244 - name : Save Cygwin packages (Cygwin)
248245 uses : actions/cache/save@v3
@@ -252,7 +249,7 @@ jobs:
252249 path : |
253250 C:\cygwin-packages
254251 key : cygwin-packages-opam-2.0.7-1
255- if : " runner.os == 'Windows' && inputs.cygwin == 'initializer' && steps.cache_cygwin.outputs.cache-hit != 'true'"
252+ if : " runner.os == 'Windows' && inputs.cygwin && steps.cache_cygwin.outputs.cache-hit != 'true'"
256253
257254 - name : Restore OPAM state (Cygwin)
258255 uses : actions/cache/restore@v3
@@ -263,22 +260,7 @@ jobs:
263260 path : |
264261 D:\opam
265262 key : ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
266- if : " runner.os == 'Windows' && inputs.cygwin != ''"
267-
268- - name : Wait for the cache (Cygwin)
269- run : sleep 3600
270- if : " runner.os == 'Windows' && inputs.cygwin == 'waiter' && steps.cache_opam.outputs.cache-hit != 'true'"
271-
272- - name : Retry restoring OPAM packages (Cygwin)
273- uses : actions/cache/restore@v3
274- env :
275- PATH : ${{ steps.presetup.outputs.cache_path }}
276- with :
277- path : |
278- D:\opam
279- key : ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
280- fail-on-cache-miss : true
281- if : " runner.os == 'Windows' && inputs.cygwin == 'waiter' && steps.cache_opam.outputs.cache-hit != 'true'"
263+ if : " runner.os == 'Windows' && inputs.cygwin"
282264
283265 - name : Install OCaml compiler ${{ env.COMPILER }} (Cygwin)
284266 run : |
@@ -289,7 +271,7 @@ jobs:
289271 opam repository add --all dra27 "https://github.com/dra27/opam-repository.git#windows-5.0"
290272 opam repository add --all local "./.github/opam/custom/"
291273 opam switch create default --repositories=dra27,override,windows,main --packages "${env:COMPILER}"
292- if : " runner.os == 'Windows' && inputs.cygwin == 'initializer' && steps.cache_opam.outputs.cache-hit != 'true'"
274+ if : " runner.os == 'Windows' && inputs.cygwin && steps.cache_opam.outputs.cache-hit != 'true'"
293275
294276 - name : Set up macOS environment ($OPAMJOBS)
295277 if : runner.os == 'macOS'
@@ -316,7 +298,7 @@ jobs:
316298 path : |
317299 D:\opam
318300 key : ${{ steps.presetup.outputs.cache_prefix }}-cygwin-opam-${{ env.COMPILER }}
319- if : " runner.os == 'Windows' && inputs.cygwin == 'initializer' "
301+ if : " runner.os == 'Windows' && inputs.cygwin"
320302
321303 - name : Build the test suite
322304 run : opam exec -- dune build
0 commit comments