Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruhlmann committed Mar 19, 2024
0 parents commit 36808ac
Show file tree
Hide file tree
Showing 15 changed files with 197 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: OCaml CI

on: [push, pull_request]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup OCaml
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: '4.14.0'

- name: Check
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev
opam install . --deps-only --with-test --with-doc
opam install ocamlformat
eval $(opam env)
make lint
make test
make
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_opam/
_build/
_coverage/
Empty file added .ocamlformat
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Andreas Krühlmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include make/ocaml/main.mk
46 changes: 46 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
(lang dune 3.10)

(name relic-sdk)

(generate_opam_files true)

(source
(github AoeCenter/relic-sdk))

(authors "Andreas Kr\195\188hlmann")

(maintainers "echo 'YW5kcmVhc0BrcnVobG1hbm4uZGV2Cg==' | base64 -d")

(license MIT)

(documentation https://github.com/AoeCenter/relic-sdk)

(package
(name relic-sdk)
(depends
(ocaml
(>= 4.14))
(cohttp-lwt-unix
(>= 5.3.0))
(yojson
(>= 2.1.2))
(lwt
(>= 5.7.0))
(lwt_ssl
(>= 1.2.0))
(alcotest
(and
:with-test
(>= 1.3.0)))
(bisect_ppx
(and
:with-test
(>= 2.3.0)))
(ocamlformat
(and
:with-dev-setup
(>= 0.26.1)))
(base
(>= v0.12.0))
dune
dune-build-info))
Empty file added lib/clien.ml
Empty file.
8 changes: 8 additions & 0 deletions lib/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(include_subdirs qualified)

(library
(name relic_sdk)
(public_name relic-sdk)
(libraries yojson cohttp-lwt-unix)
(instrumentation
(backend bisect_ppx)))
7 changes: 7 additions & 0 deletions make/ocaml/_build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: watch
build: $(BUILD_DEPS)
dune build

.PHONY: watch
watch: $(BUILD_DEPS)
dune build -w
7 changes: 7 additions & 0 deletions make/ocaml/_install.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: install
install:
opam install . --deps-only

.PHONY: install-all
install-all:
opam install . --deps-only --with-test --with-doc
7 changes: 7 additions & 0 deletions make/ocaml/_lint.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: lint
lint:
dune build @fmt

.PHONY: fix
fix:
dune build @fmt --auto-promote
6 changes: 6 additions & 0 deletions make/ocaml/_test.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: test
test:
find . -name '*.coverage' | xargs rm -f
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html
bisect-ppx-report summary
11 changes: 11 additions & 0 deletions make/ocaml/main.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.ONESHELL:
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))

.PHONY: all
all: build

include $(SELF_DIR)/_build.mk
include $(SELF_DIR)/_install.mk
include $(SELF_DIR)/_lint.mk
include $(SELF_DIR)/_test.mk

37 changes: 37 additions & 0 deletions relic-sdk.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: ["echo 'YW5kcmVhc0BrcnVobG1hbm4uZGV2Cg==' | base64 -d"]
authors: ["Andreas Krühlmann"]
license: "MIT"
homepage: "https://github.com/AoeCenter/relic-sdk"
doc: "https://github.com/AoeCenter/relic-sdk"
bug-reports: "https://github.com/AoeCenter/relic-sdk/issues"
depends: [
"ocaml" {>= "4.14"}
"cohttp-lwt-unix" {>= "5.3.0"}
"yojson" {>= "2.1.2"}
"lwt" {>= "5.7.0"}
"lwt_ssl" {>= "1.2.0"}
"alcotest" {with-test & >= "1.3.0"}
"bisect_ppx" {with-test & >= "2.3.0"}
"ocamlformat" {with-dev-setup & >= "0.26.1"}
"base" {>= "v0.12.0"}
"dune" {>= "3.10"}
"dune-build-info"
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/AoeCenter/relic-sdk.git"
16 changes: 16 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";
pkgs = import nixpkgs { config = {}; overlays = []; };
in


pkgs.mkShell{
packages = with pkgs; [
gmp
ocaml
opam
openssl
ocamlPackages.ocamlformat
pkg-config
];
}

0 comments on commit 36808ac

Please sign in to comment.