File tree Expand file tree Collapse file tree
.github/actions/setup-ocaml Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,29 @@ RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
99 ninja-build \
1010 && rm -rf /var/lib/apt/lists/*
1111
12+ # wasm_of_ocaml requires Binaryen 119 or newer.
13+ ARG BINARYEN_VERSION=131
14+ RUN case "$(dpkg --print-architecture)" in \
15+ amd64) \
16+ binaryen_platform=x86_64-linux; \
17+ binaryen_checksum=b5bf1f0eaf17c63ee588ff7a5954dc8f6ce2c26989051c66f24dfe9ece3e46db \
18+ ;; \
19+ arm64) \
20+ binaryen_platform=aarch64-linux; \
21+ binaryen_checksum=ba991f677edd9a21d2bc96c0144bc8ac5b112d4d98a3eb266e075e22e557df2a \
22+ ;; \
23+ *) echo "Unsupported Binaryen architecture" >&2; exit 1 ;; \
24+ esac \
25+ && binaryen_archive="binaryen-version_${BINARYEN_VERSION}-${binaryen_platform}.tar.gz" \
26+ && curl -fsSL \
27+ "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${binaryen_archive}" \
28+ -o "/tmp/${binaryen_archive}" \
29+ && echo "${binaryen_checksum} /tmp/${binaryen_archive}" | sha256sum --check \
30+ && sudo mkdir -p /opt/binaryen \
31+ && sudo tar -xzf "/tmp/${binaryen_archive}" --strip-components=1 -C /opt/binaryen \
32+ && rm "/tmp/${binaryen_archive}"
33+ ENV PATH="/opt/binaryen/bin:${PATH}"
34+
1235# Install OPAM
1336ARG OPAM_VERSION=2.5.0
1437RUN printf '\n\n ' | bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version $OPAM_VERSION"
Original file line number Diff line number Diff line change @@ -23,6 +23,51 @@ outputs:
2323runs :
2424 using : composite
2525 steps :
26+ - name : Install Binaryen
27+ if : runner.os != 'Windows'
28+ shell : bash
29+ env :
30+ BINARYEN_VERSION : " 131"
31+ run : |
32+ case "$RUNNER_OS-$RUNNER_ARCH" in
33+ Linux-X64)
34+ platform=x86_64-linux
35+ checksum=b5bf1f0eaf17c63ee588ff7a5954dc8f6ce2c26989051c66f24dfe9ece3e46db
36+ ;;
37+ Linux-ARM64)
38+ platform=aarch64-linux
39+ checksum=ba991f677edd9a21d2bc96c0144bc8ac5b112d4d98a3eb266e075e22e557df2a
40+ ;;
41+ macOS-X64)
42+ platform=x86_64-macos
43+ checksum=d209fadd8a894bdaf3bd3612a23c32a0af184d2f4a979b8c789e6e4f6a4de883
44+ ;;
45+ macOS-ARM64)
46+ platform=arm64-macos
47+ checksum=e441b48dc22163d209b4f05e44dc7210909b01237642b6c9ae48fd710a3ef83e
48+ ;;
49+ *)
50+ echo "Unsupported Binaryen platform: $RUNNER_OS-$RUNNER_ARCH" >&2
51+ exit 1
52+ ;;
53+ esac
54+
55+ archive="binaryen-version_${BINARYEN_VERSION}-${platform}.tar.gz"
56+ install_dir="$RUNNER_TOOL_CACHE/binaryen/$BINARYEN_VERSION/$RUNNER_ARCH"
57+ curl -fsSL \
58+ "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${archive}" \
59+ -o "$RUNNER_TEMP/$archive"
60+
61+ if command -v sha256sum >/dev/null; then
62+ echo "$checksum $RUNNER_TEMP/$archive" | sha256sum --check
63+ else
64+ echo "$checksum $RUNNER_TEMP/$archive" | shasum -a 256 --check
65+ fi
66+
67+ mkdir -p "$install_dir"
68+ tar -xzf "$RUNNER_TEMP/$archive" --strip-components=1 -C "$install_dir"
69+ echo "$install_dir/bin" >> "$GITHUB_PATH"
70+
2671 - name : Get OPAM cache key
2772 id : cache-key
2873 shell : bash
You can’t perform that action at this time.
0 commit comments