Skip to content

Commit 81faf0b

Browse files
authored
Merge pull request #313 from shym/cygwin-bis
Split the CI for Cygwin into 2 jobs rather than 2 workflows
2 parents 3cae69c + e9c79ad commit 81faf0b

File tree

5 files changed

+38
-60
lines changed

5 files changed

+38
-60
lines changed

.github/workflows/common.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ on:
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
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Cygwin trunk
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
part1:
7+
uses: ./.github/workflows/common.yml
8+
with:
9+
runs_on: windows-latest
10+
compiler: ocaml.5.1.0
11+
cygwin: true
12+
compiler_git_ref: refs/heads/trunk
13+
timeout: 360
14+
subsuite: src/array src/atomic src/bigarray src/buffer src/bytes src/domain src/dynlink src/ephemeron src/floatarray src/hashtbl src/io
15+
16+
part2:
17+
needs: part1
18+
if: ${{ always() }}
19+
uses: ./.github/workflows/common.yml
20+
with:
21+
runs_on: windows-latest
22+
compiler: ocaml.5.1.0
23+
cygwin: true
24+
compiler_git_ref: refs/heads/trunk
25+
timeout: 360
26+
subsuite: src/lazy src/neg_tests src/queue src/semaphore src/stack src/statistics src/sys src/thread src/threadomain src/weak

.github/workflows/cygwin1-510-trunk-workflow.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/cygwin2-510-trunk-workflow.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Multicore tests
1616
[![Linux 32-bit 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/linux-510-32bit-trunk-workflow.yml)
1717
[![Windows 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-workflow.yml)
1818
[![Windows 5.1.0+trunk-bytecode](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/windows-510-trunk-bytecode-workflow.yml)
19-
20-
[![Cygwin trunk (1)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin1-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin1-510-trunk-workflow.yml)
21-
[![Cygwin trunk (2)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin2-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin2-510-trunk-workflow.yml)
19+
[![Cygwin 5.1.0+trunk](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin-510-trunk-workflow.yml/badge.svg)](https://github.com/ocaml-multicore/multicoretests/actions/workflows/cygwin-510-trunk-workflow.yml)
2220

2321
Property-based tests of (parts of) the OCaml multicore compiler and run time.
2422

0 commit comments

Comments
 (0)