Skip to content

Commit 40aaec2

Browse files
committed
Updated makefile to include opam check
1 parent c6529e9 commit 40aaec2

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@ jobs:
4040
ledger-tests:
4141
timeout-minutes: 20
4242
runs-on: ubuntu-24.04
43+
strategy:
44+
matrix:
45+
ocaml_version: [4.14.2]
4346
steps:
4447
- name: Git checkout
4548
uses: actions/checkout@v5
4649

4750
- name: Setup build dependencies
4851
uses: ./.github/actions/setup-build-deps
4952

53+
- name: Use shared OCaml setting up steps
54+
uses: ./.github/actions/setup-ocaml
55+
with:
56+
ocaml_version: ${{ matrix.ocaml_version }}
57+
5058
- name: Setup Rust
5159
uses: ./.github/actions/setup-rust
5260
with:
@@ -97,13 +105,21 @@ jobs:
97105
vrf-tests:
98106
timeout-minutes: 8
99107
runs-on: ubuntu-24.04
108+
strategy:
109+
matrix:
110+
ocaml_version: [4.14.2]
100111
steps:
101112
- name: Git checkout
102113
uses: actions/checkout@v5
103114

104115
- name: Setup build dependencies
105116
uses: ./.github/actions/setup-build-deps
106117

118+
- name: Use shared OCaml setting up steps
119+
uses: ./.github/actions/setup-ocaml
120+
with:
121+
ocaml_version: ${{ matrix.ocaml_version }}
122+
107123
- name: Setup Rust
108124
uses: ./.github/actions/setup-rust
109125
with:

.github/workflows/doc-commands.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ concurrency:
2222
jobs:
2323
test-doc-commands:
2424
runs-on: ubuntu-22.04
25+
strategy:
26+
matrix:
27+
ocaml_version: [4.14.2]
2528
steps:
2629
- name: Git checkout
2730
uses: actions/checkout@v5
@@ -36,6 +39,11 @@ jobs:
3639
toolchain: 1.84
3740
cache-prefix: test-doc-commands-v0
3841

42+
- name: Use shared OCaml setting up steps
43+
uses: ./.github/actions/setup-ocaml
44+
with:
45+
ocaml_version: ${{ matrix.ocaml_version }}
46+
3947
- name: Download circuits files
4048
uses: ./.github/actions/setup-circuits
4149

.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)