Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add OCaml 5.0.0 compatibility #27

Merged
merged 8 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ocaml-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
matrix:
ocaml-version:
- 4.13.1
- 5.0.0
arch:
- amd64
# - arm64 # it's taking too long for the purpose of validation
Expand All @@ -36,6 +37,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up env var
run: echo "PACKAGE_INSTALL_SCRIPT_FILENAME=install_ocaml_$(eval cut -d'.' -f1 <<< ${{ matrix.ocaml-version }})_packages.sh" >> $GITHUB_ENV
haochenx marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up QEMU for arm64
uses: docker/setup-qemu-action@v2
with:
Expand Down Expand Up @@ -64,6 +68,7 @@ jobs:
build-args: |
NODE_VERSION=${{ matrix.node-version }}
OCAML_VERSION=${{ matrix.ocaml-version }}
PACKAGE_INSTALL_SCRIPT_FILENAME=${{ env.PACKAGE_INSTALL_SCRIPT_FILENAME }}
cache-from: type=local,src=${{ env.CACHE_DIR }}/.buildx-cache
cache-to: type=local,dest=${{ env.CACHE_DIR }}/.buildx-cache-new,mode=max

Expand All @@ -81,8 +86,7 @@ jobs:
- 4.12.1
- 4.13.1
- 4.14.1
# OCaml 5.x is not supported yet
# - 5.0.0
- 5.0.0
arch:
- amd64
- arm64
Expand All @@ -104,6 +108,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up env var
run: echo "PACKAGE_INSTALL_SCRIPT_FILENAME=install_ocaml_$(eval cut -d'.' -f1 <<< ${{ matrix.ocaml-version }})_packages.sh" >> $GITHUB_ENV

- name: Set up QEMU for arm64
uses: docker/setup-qemu-action@v2
with:
Expand Down Expand Up @@ -139,6 +146,7 @@ jobs:
build-args: |
NODE_VERSION=${{ matrix.node-version }}
OCAML_VERSION=${{ matrix.ocaml-version }}
PACKAGE_INSTALL_SCRIPT_FILENAME=${{ env.PACKAGE_INSTALL_SCRIPT_FILENAME }}
tags: "ghcr.io/kxcteam/ocaml-general:${{ env.DOCKER_TAG }},ghcr.io/kxcteam/ocaml-general:${{ env.DOCKER_TAG }}-${{ github.sha }}"
cache-from: type=local,src=${{ env.CACHE_DIR }}/.buildx-cache
cache-to: type=local,dest=${{ env.CACHE_DIR }}/.buildx-cache-new,mode=max
Expand All @@ -153,6 +161,7 @@ jobs:
build-args: |
NODE_VERSION=${{ matrix.node-version }}
OCAML_VERSION=${{ matrix.ocaml-version }}
PACKAGE_INSTALL_SCRIPT_FILENAME=${{ env.PACKAGE_INSTALL_SCRIPT_FILENAME }}
tags: "ghcr.io/kxcteam/ocaml-general:${{ matrix.ocaml-version }},ghcr.io/kxcteam/ocaml-general:${{ matrix.ocaml-version }}-${{ github.sha }}"
cache-from: type=local,src=${{ env.CACHE_DIR }}/.buildx-cache-new

Expand Down
24 changes: 3 additions & 21 deletions ocaml-general/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,11 @@ RUN apt-get update && apt-get install -y \
opam

ARG OCAML_VERSION=4.13.1
kxc-wraikny marked this conversation as resolved.
Show resolved Hide resolved
ARG PACKAGE_INSTALL_SCRIPT_FILENAME=install_ocaml_4_packages.sh
RUN opam init --auto-setup --yes --bare --disable-sandboxing
RUN opam switch create $OCAML_VERSION
RUN opam install --yes \
dune.3.4.0 \
merlin \
odoc.2.2.0 \
ppxlib.0.26.0 \
ppx_deriving.5.2.1 \
js_of_ocaml.4.1.0 js_of_ocaml-ppx.4.1.0 js_of_ocaml-ppx.4.1.0 \
sexplib.v0.15.0 ppx_sexp_conv.v0.15.1 \
yojson.1.7.0 ppx_yojson_conv.v0.15.0 \
jsonm.1.0.1 \
ppx_optcomp.v0.15.0 \
brr.0.0.4 \
prr.0.1.1 \
zed.3.2.0 \
tezt.3.0.0 \
ocamlformat.0.24.1 \
ppx_inline_test.v0.15.0 \
alcotest.1.6.0 \
qcheck.0.19.1 \
qcheck-alcotest.0.19.1 \
&& opam clean -y --logs --repo-cache --download-cache --switch-cleanup
COPY $PACKAGE_INSTALL_SCRIPT_FILENAME /tmp/install_packages.sh
RUN /tmp/install_packages.sh && rm /tmp/install_packages.sh

ENV DEBIAN_FRONTEND=$DEBIAN_FRONTEND_OLD
ENV OPAMROOT=/root/.opam
Expand Down
23 changes: 23 additions & 0 deletions ocaml-general/install_ocaml_4_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

opam install --yes \
dune.3.4.0 \
merlin \
odoc.2.2.0 \
ppxlib.0.26.0 \
ppx_deriving.5.2.1 \
js_of_ocaml.4.1.0 js_of_ocaml-ppx.4.1.0 js_of_ocaml-lwt.4.1.0 \
sexplib.v0.15.0 ppx_sexp_conv.v0.15.1 \
yojson.1.7.0 ppx_yojson_conv.v0.15.0 \
jsonm.1.0.1 \
ppx_optcomp.v0.15.0 \
brr.0.0.4 \
prr.0.1.1 \
zed.3.2.0 \
tezt.3.0.0 \
ocamlformat.0.24.1 \
ppx_inline_test.v0.15.0 \
alcotest.1.6.0 \
qcheck.0.19.1 \
qcheck-alcotest.0.19.1 \
&& opam clean -y --logs --repo-cache --download-cache --switch-cleanup
23 changes: 23 additions & 0 deletions ocaml-general/install_ocaml_5_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

opam install --yes \
dune.3.4.0 \
merlin \
odoc.2.2.0 \
ppxlib.0.28.0 \
ppx_deriving.5.2.1 \
js_of_ocaml.4.1.0 js_of_ocaml-ppx.4.1.0 js_of_ocaml-lwt.4.1.0 \
sexplib.v0.15.1 ppx_sexp_conv.v0.15.1 \
yojson.2.0.2 ppx_yojson_conv.v0.15.1 \
jsonm.1.0.1 \
ezjsonm.1.3.0 \
ppx_optcomp.v0.15.0 \
brr.0.0.4 \
prr.0.1.1 \
zed.3.2.0 \
tezt.3.0.0 \
ppx_inline_test.v0.15.0 \
alcotest.1.6.0 \
qcheck.0.20 \
qcheck-alcotest.0.20 \
&& opam clean -y --logs --repo-cache --download-cache --switch-cleanup