Skip to content

Commit 7ecb271

Browse files
committed
fix ci config
1 parent fabc70e commit 7ecb271

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

.github/workflows/workflow.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ jobs:
4747
runs-on: ${{ matrix.os }}
4848

4949
steps:
50-
- name: set ppx-related variables
51-
id: configppx
52-
shell: bash
53-
run: |
54-
case ${{ matrix.ocaml-compiler }} in
55-
"4.08"|"4.09"|"4.10"|"4.11"|"4.12"|"4.13"|"4.14"|"5.0")
56-
echo "letppx=false"
57-
echo "letppx=false" >> "$GITHUB_OUTPUT"
58-
;;
59-
"5.1"|"5.2"|"5.3")
60-
echo "letppx=true"
61-
echo "letppx=true" >> "$GITHUB_OUTPUT"
62-
;;
63-
*)
64-
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
65-
exit 1
66-
;;
67-
esac
6850

6951
- name: Checkout tree
7052
uses: actions/checkout@v5
@@ -74,6 +56,13 @@ jobs:
7456
with:
7557
ocaml-compiler: ${{ matrix.ocaml-compiler }}
7658

59+
- name: set ppx-related variables
60+
id: configppx
61+
shell: bash
62+
run: |
63+
opam exec -- dune exec src/util/letppx.exe
64+
opam exec -- dune exec src/util/letppx.exe >> "$GITHUB_OUTPUT"
65+
7766
- run: opam install conf-libev
7867
if: ${{ matrix.libev == true }}
7968

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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let () =
2+
match String.split_on_char '.' Sys.ocaml_version with
3+
| "4" :: _ | "5" :: "0" :: _ -> print_endline "letppx=false"
4+
| "5" :: _ -> print_endline "letppx=true"
5+
| _ ->
6+
print_endline ("unrecognised version " ^ Sys.ocaml_version);
7+
exit 1

0 commit comments

Comments
 (0)