Skip to content

Commit b15de20

Browse files
committed
Add CI workflows on Windows
This is a lot more complex than it should be because: - even with a `override` opam repository providing packages for the OCaml 5 compiler with build instructions compatible with Windows, setup-ocaml fails - many different attempts to build the compiler in a simpler way failed without many clues to help (probably because of issues with the PATH, which sh is found, or not, to call configure, etc. etc.) - ocaml-config.3 (upstream opam package) fails to install claiming the hashes in the opam package are invalid (?), so the `override` opam repository distribute that same package without the hashes - ocamlfind.1.9.5 as provided by the `default` opam repository doesn’t build with OCaml 5 since the Windows patch uses deprecated functions
1 parent 6cb3fa5 commit b15de20

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
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: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
env:
16+
COMPILER: ${{ inputs.compiler }}
17+
QCHECK_MSG_INTERVAL: '60'
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Install opam etc. with a temporary compiler
24+
uses: ocaml/setup-ocaml@v2
25+
with:
26+
ocaml-compiler: 4.14
27+
opam-repositories: |
28+
default: https://github.com/fdopen/opam-repository-mingw.git#opam2
29+
override: https://github.com/shym/custom-opam-repository.git#windows
30+
upstream: https://github.com/ocaml/opam-repository.git
31+
alpha: https://github.com/kit-ty-kate/opam-alpha-repository.git
32+
opam-pin: false
33+
opam-depext: false
34+
35+
- name: Build and install the OCaml ${{ inputs.compiler }} compiler in a `ci` switch
36+
run: |
37+
opam switch create ci --empty --no-switch --repositories=default,override,upstream,alpha
38+
git clone https://github.com/ocaml/ocaml -b $Env:COMPILER --depth=1 --recurse-submodules
39+
cd ocaml
40+
curl https://github.com/shym/ocaml/commit/cca99d36bc5326dbe48fd9aaa10357b7de869bbc.patch | git -c user.name=CI -c user.email="[email protected]" am
41+
opam install --switch=ci .
42+
git log
43+
cd ..
44+
rmdir -Recurse -Force ocaml
45+
46+
- name: Show environment
47+
run: |
48+
opam exec --switch=ci -- ocamlopt --version
49+
opam config list --switch=ci
50+
51+
- name: Install Multicore Tests dependencies
52+
run: |
53+
opam pin --switch=ci add "https://github.com/shym/ocamlfind.git#fix-win"
54+
opam install --switch=ci . --deps-only --with-test
55+
56+
- name: Build the test suite
57+
run: opam exec --switch=ci -- dune build
58+
59+
- name: Run the test suite
60+
run: opam exec --switch=ci -- dune runtest -j1 --no-buffer --display=quiet --cache=disabled --error-reporting=twice

0 commit comments

Comments
 (0)