Skip to content

Commit c7ec8a2

Browse files
authored
Add dune file (#709)
1 parent 44dc69c commit c7ec8a2

File tree

6 files changed

+97
-6
lines changed

6 files changed

+97
-6
lines changed

.github/workflows/opam.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: opam CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
name: Build
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
- macos-latest
22+
# Windows is deactivated since it doesn't find dune 3.6.0 and we need it for dune lang 3.5
23+
# - windows-latest
24+
25+
ocaml-compiler:
26+
- 4.14.x
27+
28+
runs-on: ${{ matrix.os }}
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
34+
- name: Use OCaml ${{ matrix.ocaml-compiler }}
35+
uses: ocaml/setup-ocaml@v2
36+
with:
37+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
38+
39+
- name: Load opam cache when not Windows
40+
if: runner.os != 'Windows'
41+
id: opam-cache
42+
uses: actions/cache/restore@v3
43+
with:
44+
path: ~/.opam
45+
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
46+
47+
- name: Load opam cache when Windows
48+
if: runner.os == 'Windows'
49+
id: opam-cache-windows
50+
uses: actions/cache/restore@v3
51+
with:
52+
path: _opam
53+
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
54+
55+
- name: Install dependencies
56+
run: opam install . --deps-only
57+
58+
- name: Build
59+
run: opam exec -- dune build
60+
61+
- name: Test
62+
run: echo "todo"
63+
64+
- name: Save cache when not Windows
65+
uses: actions/cache/save@v3
66+
if: steps.opam-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
67+
with:
68+
path: ~/.opam
69+
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}
70+
71+
- name: Save cache when Windows
72+
uses: actions/cache/save@v3
73+
if: steps.opam-cache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows'
74+
with:
75+
path: _opam
76+
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
lib/bs/
33
.merlin
44
docs
5+
_build

dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(dirs src test)

dune-project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(lang dune 3.7)
2+
(using melange 0.1)

reason-react-dev.opam

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
opam-version: "2.0"
2-
synopsis: "reason-react"
32
homepage: "https://reasonml.github.io/reason-react/"
43
bug-reports: "https://github.com/reasonml/reason-react/issues"
4+
description: """
5+
ReasonReact helps you use Reason to build React components with deeply integrated, strong, static type safety.
6+
7+
It is designed and built by people using Reason and React in large, mission critical production React codebases.
8+
"""
9+
synopsis: "Reason bindings for React.js"
10+
maintainer: "David Sancho <[email protected]>"
11+
author: [ "Cheng Lou <[email protected]>" "Ricky Vetter <[email protected]>"]
512
depends: [
6-
"dune" {>= "2.7" & < "3"}
7-
"ocaml" {= "4.06.1"}
8-
"ocaml-lsp-server" {= "1.4.1"}
9-
"reason" {= "3.8.2"}
10-
"merlin" {= "3.4.0"}
13+
"dune" {>= "3.6.0" & < "4"}
14+
"ocaml" {> "4.06.1" & < "5"}
15+
"ocaml-lsp-server" {> "1.4.1" & <= "1.15.1-4.14"}
16+
"reason" {<= "3.8.2" & < "4"}
1117
]
1218
build: [
1319
["dune" "subst"] {dev}

src/dune

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(library
2+
(name reason_react)
3+
(wrapped false)
4+
(flags :standard -bs-jsx 3)
5+
(modes melange))

0 commit comments

Comments
 (0)