Skip to content

Commit 01e56b0

Browse files
authored
Merge pull request #179 from shym/windows-ci-v2
Add CI workflows on Windows
2 parents 8450d02 + 48ff8a1 commit 01e56b0

File tree

4 files changed

+111
-2
lines changed

4 files changed

+111
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Windows 5.0.0+trunk
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
uses: ./.github/workflows/windows.yml
8+
with:
9+
compiler: '5.0'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: Windows 5.0.0-beta1
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
uses: ./.github/workflows/windows.yml

.github/workflows/windows.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Windows mingw64 common workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
compiler:
7+
description: 'Branch or tag of ocaml/ocaml to use as compiler'
8+
type: string
9+
default: '5.0.0-beta1'
10+
only_test:
11+
description: 'Only test to run (eg “src/array/lin_tests.exe”); whole suite is run if empty'
12+
type: string
13+
default: ''
14+
seed:
15+
description: 'Seed for the only test'
16+
type: string
17+
default: ''
18+
repeats:
19+
description: 'Number of test attempts'
20+
type: string
21+
default: '2'
22+
23+
jobs:
24+
build:
25+
runs-on: windows-latest
26+
27+
env:
28+
COMPILER: ${{ inputs.compiler }}
29+
ONLY_TEST: ${{ inputs.only_test }}
30+
SEED: ${{ inputs.seed }}
31+
REPEATS: ${{ inputs.repeats }}
32+
QCHECK_MSG_INTERVAL: '60'
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
38+
- name: Install opam etc. with a temporary compiler
39+
uses: ocaml/setup-ocaml@v2
40+
with:
41+
ocaml-compiler: 4.14
42+
opam-repositories: |
43+
default: https://github.com/fdopen/opam-repository-mingw.git#opam2
44+
override: https://github.com/shym/custom-opam-repository.git#windows
45+
upstream: https://github.com/ocaml/opam-repository.git
46+
alpha: https://github.com/kit-ty-kate/opam-alpha-repository.git
47+
opam-pin: false
48+
opam-depext: false
49+
50+
- name: Build and install the OCaml ${{ inputs.compiler }} compiler in a `ci` switch
51+
run: |
52+
opam switch create ci --empty --no-switch --repositories=default,override,upstream,alpha
53+
git clone https://github.com/ocaml/ocaml -b $Env:COMPILER --depth=1 --recurse-submodules
54+
cd ocaml
55+
curl https://github.com/shym/ocaml/commit/cca99d36bc5326dbe48fd9aaa10357b7de869bbc.patch | git -c user.name=CI -c user.email="[email protected]" am
56+
opam install --switch=ci .
57+
git log
58+
cd ..
59+
rmdir -Recurse -Force ocaml
60+
61+
- name: Show environment
62+
run: |
63+
opam exec --switch=ci -- ocamlopt --version
64+
opam config list --switch=ci
65+
66+
- name: Install Multicore Tests dependencies
67+
run: |
68+
opam pin --switch=ci add "https://github.com/shym/ocamlfind.git#fix-win"
69+
opam install --switch=ci . --deps-only --with-test
70+
71+
- name: Build the test suite
72+
run: opam exec --switch=ci -- dune build
73+
if: inputs.only_test == ''
74+
75+
- name: Run the test suite
76+
run: opam exec --switch=ci -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice
77+
if: inputs.only_test == ''
78+
79+
- name: Run only one test
80+
run: |
81+
$ErrorActionPreference = 'Continue'
82+
$failures = 0
83+
for($i = 1; $i -le "${env:REPEATS}"; $i++) {
84+
if("${env:SEED}" -eq "") {
85+
opam exec --switch=ci -- dune exec "${env:ONLY_TEST}" -- -v
86+
if($? -eq 0) { $failures += 1 }
87+
} else {
88+
opam exec --switch=ci -- dune exec "${env:ONLY_TEST}" -- -v -s "${env:SEED}"
89+
if($? -eq 0) { $failures += 1 }
90+
}
91+
}
92+
echo "Test failed $failures times"
93+
if: inputs.only_test != ''

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Multicore tests
22
===============
33

4-
[![Linux 5.0.0~beta1](https://github.com/jmid/multicoretests/actions/workflows/linux-500-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-workflow.yml) [![MacOSX 5.0.0~beta1](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-workflow.yml) [![Linux 5.0.0~beta1-bytecode](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml)
4+
[![Linux 5.0.0~beta1](https://github.com/jmid/multicoretests/actions/workflows/linux-500-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-workflow.yml) [![MacOSX 5.0.0~beta1](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-workflow.yml) [![Linux 5.0.0~beta1-bytecode](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-workflow.yml) [![Windows 5.0.0~beta1](https://github.com/jmid/multicoretests/actions/workflows/windows-500-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/windows-500-workflow.yml)
55

6-
[![Linux 5.0.0+trunk](https://github.com/jmid/multicoretests/actions/workflows/linux-500-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-trunk-workflow.yml) [![MacOSX 5.0.0+trunk](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-trunk-workflow.yml) [![Linux 5.0.0+trunk-bytecode](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-trunk-workflow.yml)
6+
[![Linux 5.0.0+trunk](https://github.com/jmid/multicoretests/actions/workflows/linux-500-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-trunk-workflow.yml) [![MacOSX 5.0.0+trunk](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/macosx-500-trunk-workflow.yml) [![Linux 5.0.0+trunk-bytecode](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/linux-500-bytecode-trunk-workflow.yml) [![Windows 5.0.0+trunk](https://github.com/jmid/multicoretests/actions/workflows/windows-500-trunk-workflow.yml/badge.svg)](https://github.com/jmid/multicoretests/actions/workflows/windows-500-trunk-workflow.yml)
77

88
Experimental property-based tests of (parts of) the OCaml multicore compiler.
99

0 commit comments

Comments
 (0)