Skip to content

Commit b06ed14

Browse files
adapt workflow to mish mash of compatibility to ocaml versions
1 parent 6568544 commit b06ed14

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

.github/workflows/workflow.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
- ubuntu-latest
1717
ocaml-compiler:
1818
- "4.14"
19+
- "5.0"
20+
- "5.1"
21+
- "5.2"
1922
- "5.3"
2023
libev:
2124
- true
@@ -34,24 +37,42 @@ jobs:
3437
runs-on: ${{ matrix.os }}
3538

3639
steps:
37-
- name: set ppx-related variables
38-
id: configppx
40+
- name: set version-dependent variables
41+
id: configpkgs
3942
shell: bash
4043
run: |
44+
opampkgs="./lwt.opam ./lwt_react.opam ./lwt_retry.opam ./lwt_ppx.opam"
45+
dunepkgs="lwt,lwt_react,lwt_retry,lwt_ppx"
4146
case ${{ matrix.ocaml-compiler }} in
42-
"4.08"|"4.09"|"4.10"|"4.11"|"4.12"|"4.13"|"4.14"|"5.0")
43-
echo "letppx=false"
44-
echo "letppx=false" >> "$GITHUB_OUTPUT"
47+
"4.14"|"5.0")
48+
:
4549
;;
4650
"5.1"|"5.2"|"5.3")
47-
echo "letppx=true"
48-
echo "letppx=true" >> "$GITHUB_OUTPUT"
51+
opampkgs="${opampkgs} ./lwt_ppx__ppx_let_tests.opam"
52+
dunepkgs="${dunepkgs},lwt_ppx__ppx_let_tests"
4953
;;
5054
*)
5155
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
5256
exit 1
5357
;;
5458
esac
59+
case ${{ matrix.ocaml-compiler }} in
60+
"4.14")
61+
:
62+
;;
63+
"5.0"|"5.1"|"5.2"|"5.3")
64+
opampkgs="${opampkgs} ./lwt_direct.opam"
65+
dunepkgs="${dunepkgs},lwt_direct"
66+
;;
67+
*)
68+
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
69+
exit 1
70+
;;
71+
esac
72+
echo "opampkgs=${opampkgs}"
73+
echo "opampkgs=${opampkgs}" >> "$GITHUB_OUTPUT"
74+
echo "dunepkgs=${dunepkgs}"
75+
echo "dunepkgs=${dunepkgs}" >> "$GITHUB_OUTPUT"
5576
5677
- name: Checkout tree
5778
uses: actions/checkout@v5
@@ -64,20 +85,11 @@ jobs:
6485
- run: opam install conf-libev
6586
if: ${{ matrix.libev == true }}
6687

67-
- run: opam install ./lwt.opam ./lwt_direct.opam ./lwt_react.opam ./lwt_retry.opam ./lwt_ppx.opam --deps-only --with-test
68-
69-
- run: opam install ./lwt_ppx__ppx_let_tests.opam --deps-only --with-test
70-
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
71-
72-
- run: opam exec -- dune build --only-packages lwt,lwt_direct,lwt_react,lwt_retry
73-
74-
- run: opam exec -- dune build --only-packages lwt,lwt_ppx__ppx_let_tests
75-
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
88+
- run: opam install --deps-only --with-test ${{ steps.configpkgs.outputs.opampkgs }}
7689

77-
- run: opam exec -- dune runtest --only-packages lwt,lwt_direct,lwt_react,lwt_retry,lwt_ppx
90+
- run: opam exec -- dune build --only-packages ${{ steps.configpkgs.outputs.dunepkgs }}
7891

79-
- run: opam exec -- dune runtest --only-packages lwt,lwt_ppx__ppx_let_tests
80-
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
92+
- run: opam exec -- dune runtest --only-packages ${{ steps.configpkgs.outputs.dunepkgs }}
8193

8294
lint-opam:
8395
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)