Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
46 changes: 8 additions & 38 deletions .github/workflows/opam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: opam CI
on:
pull_request:
push:
branches:
- main
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -19,9 +19,6 @@ jobs:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
# It seems like dune 3.8 isn't available under opam-repository-mingw for Windows
# disabling this for now

ocaml-compiler:
- ocaml-base-compiler.5.5.2
Expand All @@ -32,35 +29,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Load opam cache when not Windows
if: runner.os != 'Windows'
id: opam-cache
uses: actions/cache/restore@v5
with:
path: ~/.opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Load opam cache when Windows
if: runner.os == 'Windows'
id: opam-cache-windows
uses: actions/cache/restore@v5
with:
path: _opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install OCaml dependencies
run: opam install . --deps-only --with-test -y

- name: Install dependencies
run: make install
- name: Install JavaScript dependencies
run: npm ci

- name: Build
run: make build
Expand All @@ -70,17 +54,3 @@ jobs:

- name: Jest
run: make jest

- name: Save cache when not Windows
uses: actions/cache/save@v5
if: steps.opam-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
with:
path: ~/.opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Save cache when Windows
uses: actions/cache/save@v5
if: steps.opam-cache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows'
with:
path: _opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DUNE = opam exec -- dune
OCAML_VERSION ?= 5.5.2

.PHONY: help
help: ## Print this help message
Expand Down Expand Up @@ -59,11 +60,11 @@ format-check: ## Checks if format is correct
.PHONY: install
install: ## Update the package dependencies when new deps are added to dune-project
@opam install . --deps-only --with-test --with-dev-setup -y
@npm install --force
@npm ci

.PHONY: init
.PHONY: create-switch
create-switch: ## Create a local opam switch
@opam switch create . 5.5.2 --no-install -y
@opam switch create . $(OCAML_VERSION) --no-install -y

.PHONY: init
init: create-switch install ## Create a local opam switch, install deps
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
buildDunePackage
melange
merlin
ppxlib_gt_0_37
ppxlib
reason
;
packages = rec {
Expand Down Expand Up @@ -58,7 +58,7 @@
merlin
pkgs.jq
];
propagatedBuildInputs = [ ppxlib_gt_0_37 ];
propagatedBuildInputs = [ ppxlib ];
};

reason-react = buildDunePackage {
Expand Down
Loading