Skip to content

Commit 716c108

Browse files
committed
Updated makefile to include opam check
1 parent c6529e9 commit 716c108

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ jobs:
5151
matrix:
5252
os: [ubuntu-24.04]
5353
toolchain: [nightly]
54+
ocaml_version: [4.14.2]
5455
steps:
5556
- uses: actions/checkout@v5
5657
- name: Setup build dependencies
5758
uses: ./.github/actions/setup-build-deps
59+
- name: Use shared OCaml setting up steps
60+
uses: ./.github/actions/setup-ocaml
61+
with:
62+
ocaml_version: ${{ matrix.ocaml_version }}
5863
- name: Setup Rust
5964
uses: ./.github/actions/setup-rust
6065
with:

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ NETWORK ?= devnet
2525
VERBOSITY ?= info
2626
GIT_COMMIT := $(shell git rev-parse --short=8 HEAD)
2727

28+
OPAM_PATH := $(shell command -v opam 2>/dev/null)
29+
30+
ifdef OPAM_PATH
31+
# This captures what `eval $(opam env)` would set in your shell
32+
OPAM_ENV := $(shell eval $$(opam env) && env | grep '^OPAM\|^PATH\|^CAML' | sed 's/^/export /')
33+
export $(shell eval $$(opam env) && env | grep '^OPAM\|^PATH\|^CAML' | cut -d= -f1)
34+
$(foreach v,$(shell eval $$(opam env) && env | grep '^OPAM\|^PATH\|^CAML'),$(eval export $(v)))
35+
endif
36+
2837
.PHONY: help
2938
help: ## Ask for help!
3039
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)