Skip to content

Commit e8c2484

Browse files
Merge branch 'master' into lwt-6
* master: Better names for CI jobs move lint to a separate workflow Just run ci for PRs and master fix fix ci config add 32bit build to the CI Fix 32bit build with lang dune >= 3.0
2 parents 24dab8a + f0a4c42 commit e8c2484

File tree

5 files changed

+98
-63
lines changed

5 files changed

+98
-63
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
lint-opam:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout tree
14+
uses: actions/checkout@v5
15+
- name: Set-up OCaml
16+
uses: ocaml/setup-ocaml@v3
17+
with:
18+
ocaml-compiler: 5
19+
- uses: ocaml/setup-ocaml/lint-opam@v3

.github/workflows/workflow.yml

Lines changed: 49 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Builds, tests & co
1+
name: Builds, tests
22

33
on:
44
pull_request:
55
push:
6+
branches:
7+
- master
68
schedule:
79
# Prime the caches every Monday
810
- cron: 0 1 * * MON
@@ -15,6 +17,8 @@ jobs:
1517
os:
1618
- ubuntu-latest
1719
ocaml-compiler:
20+
- "4.14"
21+
- "5.0"
1822
- "5.1"
1923
- "5.2"
2024
- "5.3"
@@ -32,59 +36,18 @@ jobs:
3236
- os: windows-latest
3337
ocaml-compiler: "5.4"
3438
libev: false
39+
- os: ubuntu-latest
40+
ocaml-name: "5.4.0+32bit"
41+
ocaml-compiler: "ocaml-variants.5.4.0+options,ocaml-option-32bit"
42+
libev: false
43+
3544

3645
runs-on: ${{ matrix.os }}
3746

47+
name:
48+
${{ matrix.ocaml-name != '' && matrix.ocaml-name || matrix.ocaml-compiler}} / ${{ matrix.os }} / libev=${{ matrix.libev}}
49+
3850
steps:
39-
- name: set version-dependent variables
40-
id: configpkgs
41-
shell: bash
42-
run: |
43-
opampkgs="./lwt.opam ./lwt_react.opam ./lwt_retry.opam ./lwt_ppx.opam"
44-
dunepkgs="lwt,lwt_react,lwt_retry,lwt_ppx"
45-
case ${{ matrix.ocaml-compiler }} in
46-
"4.14"|"5.0")
47-
:
48-
;;
49-
"5.1"|"5.2"|"5.3"|"5.4")
50-
opampkgs="${opampkgs} ./lwt_ppx__ppx_let_tests.opam"
51-
dunepkgs="${dunepkgs},lwt_ppx__ppx_let_tests"
52-
;;
53-
*)
54-
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
55-
exit 1
56-
;;
57-
esac
58-
case ${{ matrix.ocaml-compiler }} in
59-
"4.14")
60-
:
61-
;;
62-
"5.0"|"5.1"|"5.2"|"5.3"|"5.4")
63-
opampkgs="${opampkgs} ./lwt_direct.opam"
64-
dunepkgs="${dunepkgs},lwt_direct"
65-
;;
66-
*)
67-
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
68-
exit 1
69-
;;
70-
esac
71-
case ${{ matrix.ocaml-compiler }} in
72-
"4.14"|"5.0"|"5.1"|"5.2"|"5.3")
73-
:
74-
;;
75-
"5.4")
76-
opampkgs="${opampkgs} ./lwt_runtime_events.opam"
77-
dunepkgs="${dunepkgs},lwt_runtime_events"
78-
;;
79-
*)
80-
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
81-
exit 1
82-
;;
83-
esac
84-
echo "opampkgs=${opampkgs}"
85-
echo "opampkgs=${opampkgs}" >> "$GITHUB_OUTPUT"
86-
echo "dunepkgs=${dunepkgs}"
87-
echo "dunepkgs=${dunepkgs}" >> "$GITHUB_OUTPUT"
8851

8952
- name: Checkout tree
9053
uses: actions/checkout@v5
@@ -94,22 +57,45 @@ jobs:
9457
with:
9558
ocaml-compiler: ${{ matrix.ocaml-compiler }}
9659

60+
- name: set ppx-related variables
61+
id: configpackages
62+
shell: bash
63+
run: |
64+
opam exec -- ocaml src/util/letppx.ml
65+
opam exec -- ocaml src/util/letppx.ml >> "$GITHUB_OUTPUT"
66+
9767
- run: opam install conf-libev
9868
if: ${{ matrix.libev == true }}
9969

100-
- run: opam install --deps-only --with-test ${{ steps.configpkgs.outputs.opampkgs }}
70+
- run: opam install ./lwt.opam ./lwt_react.opam ./lwt_retry.opam ./lwt_ppx.opam --deps-only --with-test
10171

102-
- run: opam exec -- dune build --only-packages ${{ steps.configpkgs.outputs.dunepkgs }}
72+
- run: opam install ./lwt_ppx__ppx_let_tests.opam --deps-only --with-test
73+
if: ${{ fromJSON(steps.configpackages.outputs.letppx) }}
10374

104-
- run: opam exec -- dune runtest --only-packages ${{ steps.configpkgs.outputs.dunepkgs }}
75+
- run: opam install ./lwt_direct.opam --deps-only --with-test
76+
if: ${{ fromJSON(steps.configpackages.outputs.direct) }}
10577

106-
lint-opam:
107-
runs-on: ubuntu-latest
108-
steps:
109-
- name: Checkout tree
110-
uses: actions/checkout@v5
111-
- name: Set-up OCaml
112-
uses: ocaml/setup-ocaml@v3
113-
with:
114-
ocaml-compiler: 5
115-
- uses: ocaml/setup-ocaml/lint-opam@v3
78+
- run: opam install ./lwt_runtime_evetns.opam --deps-only --with-test
79+
if: ${{ fromJSON(steps.configpackages.outputs.runtime_events) }}
80+
81+
- run: opam exec -- dune build --only-packages lwt,lwt_react,lwt_retry
82+
83+
- run: opam exec -- dune build --only-packages lwt,lwt_ppx__ppx_let_tests
84+
if: ${{ fromJSON(steps.configpackages.outputs.letppx) }}
85+
86+
- run: opam exec -- dune build --only-packages lwt,lwt_direct
87+
if: ${{ fromJSON(steps.configpackages.outputs.direct) }}
88+
89+
- run: opam exec -- dune build --only-packages lwt,lwt_runtime_events
90+
if: ${{ fromJSON(steps.configpackages.outputs.runtime_events) }}
91+
92+
- run: opam exec -- dune runtest --only-packages lwt,lwt_react,lwt_retry,lwt_ppx
93+
94+
- run: opam exec -- dune runtest --only-packages lwt,lwt_ppx__ppx_let_tests
95+
if: ${{ fromJSON(steps.configpackages.outputs.letppx) }}
96+
97+
- run: opam exec -- dune runtest --only-packages lwt,lwt_direct
98+
if: ${{ fromJSON(steps.configpackages.outputs.direct) }}
99+
100+
- run: opam exec -- dune runtest --only-packages lwt,lwt_runtime_events
101+
if: ${{ fromJSON(steps.configpackages.outputs.runtime_events) }}

src/unix/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
windows_somaxconn
190190
unix_accept4)
191191
(flags
192+
(:standard)
192193
(:include unix_c_flags.sexp)))
193194
(c_library_flags
194195
(:include unix_c_library_flags.sexp)))

src/util/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(executable
2+
(name letppx))

src/util/letppx.ml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
let split_version = String.split_on_char '.' Sys.ocaml_version
2+
let letppx =
3+
match split_version with
4+
| "4" :: _ | "5" :: "0" :: _ -> false
5+
| "5" :: _ -> true
6+
| _ ->
7+
print_endline ("unrecognised version " ^ Sys.ocaml_version);
8+
exit 1
9+
let () = Printf.printf "letppx=%B\n" letppx
10+
11+
let direct =
12+
match split_version with
13+
| "4" :: _ -> false
14+
| "5" :: _ -> true
15+
| _ ->
16+
print_endline ("unrecognised version " ^ Sys.ocaml_version);
17+
exit 1
18+
let () = Printf.printf "direct=%B\n" direct
19+
20+
let runtime_events =
21+
match split_version with
22+
| "4" :: _ | "5" :: ("0"|"1"|"2"|"3") :: _ -> false
23+
| "5" :: _ -> true
24+
| _ ->
25+
print_endline ("unrecognised version " ^ Sys.ocaml_version);
26+
exit 1
27+
let () = Printf.printf "runtime_events=%B\n" runtime_events

0 commit comments

Comments
 (0)