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
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build

on:
pull_request:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
strategy:
matrix:
os:
# - ubuntu-latest (already in test)
- macos-latest
# - windows-latest (libmongoc not available through cygwin)
ocaml-compiler:
- 5.3.0

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Setup OCaml ${{ matrix.ocaml-version }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Opam dependencies
run: opam install --deps-only -t .

- name: Runtest
run: opam exec -- dune build @all
54 changes: 54 additions & 0 deletions .github/workflows/deploy-odoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy documentation to GitHub Pages

on:
push:
branches:
- main

permissions: read-all

concurrency:
group: deploy-odoc
cancel-in-progress: true

jobs:
deploy-odoc:
name: Deploy odoc to GitHub Pages

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
contents: read
id-token: write
pages: write

runs-on: ubuntu-latest

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.3.0"

- name: Install dependencies
run: opam install . --deps-only --with-doc

- name: Build documentation
run: opam exec -- dune build @doc

- name: Set-up Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/default/_doc/_html

- name: Deploy odoc to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: test

on:
pull_request:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 5.3.0

runs-on: ${{ matrix.os }}

steps:
- name: Install mongosh
run: |
sudo apt-get install -y wget gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh

- uses: actions/checkout@v2

- name: Setup OCaml ${{ matrix.ocaml-version }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Opam dependencies
run: opam install --deps-only -t .

- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: "8.0"

- name: Runtest
run: opam exec -- dune runtest
2 changes: 0 additions & 2 deletions bin/omont.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

$ ./omong.exe list
admin.system.version
bitcoin.price_2017_2023
config.system.sessions
local.startup_log

Expand Down Expand Up @@ -124,7 +123,6 @@

$ mongosh list.js
admin.system.version
bitcoin.price_2017_2023
config.system.sessions
local.startup_log

19 changes: 19 additions & 0 deletions conf-libmongoc.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is generated by dune, edit dune-project instead

opam-version: "2.0"
maintainer: "Tarides <[email protected]>"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
authors: ["MongoDB"]
homepage: "https://www.mongodb.com/docs/drivers/c/"
license: "Apache-2.0"
build: ["pkg-config" "libmongoc"]
depends: ["conf-pkg-config" {build}]
depexts: [
["libmongoc-dev"] {os-family = "debian" | os-family = "ubuntu"}
["mongo-c-driver-devel"] {os-distribution = "fedora"}
["mongo-c-driver"] {os-distribution = "arch" | os = "freebsd" | os = "macos"}
["mongo-c-driver-dev"] {os-distribution = "alpine"}
]
synopsis: "Virtual package relying on a libmongoc system installation"
description: "This package can only install if libmongoc is installed on the system."
flags: conf
17 changes: 17 additions & 0 deletions conf-libmongoc.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
opam-version: "2.0"
maintainer: "Tarides <[email protected]>"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
authors: ["MongoDB"]
homepage: "https://www.mongodb.com/docs/drivers/c/"
license: "Apache-2.0"
build: ["pkg-config" "libmongoc"]
depends: ["conf-pkg-config" {build}]
depexts: [
["libmongoc-dev"] {os-family = "debian" | os-family = "ubuntu"}
["mongo-c-driver-devel"] {os-distribution = "fedora"}
["mongo-c-driver"] {os-distribution = "arch" | os = "freebsd" | os = "macos"}
["mongo-c-driver-dev"] {os-distribution = "alpine"}
]
synopsis: "Virtual package relying on a libmongoc system installation"
description: "This package can only install if libmongoc is installed on the system."
flags: conf
14 changes: 12 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
(lang dune 3.16)

(using ctypes 0.3)

(name mongoc)

(generate_opam_files true)

(package
(name mongoc)
(synopsis "OCaml binding of the libmongoc library")
(description "OCaml binding of the MongoDB client library for C, libmongoc")
(maintainers "Cuihtlauac ALVARADO")
(authors "Cuihtlauac ALVARADO")
(source (github tarides/mongoc-ocaml))
(source
(github tarides/mongoc-ocaml))
(license ISC)
(depends
(dune :build)
(ocamlformat :build)
cmdliner
ctypes))
ctypes
conf-libmongoc))

(package
(name conf-libmongoc)
(allow_empty))
1 change: 1 addition & 0 deletions mongoc.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ depends: [
"ocamlformat" {build}
"cmdliner"
"ctypes"
"conf-libmongoc"
"odoc" {with-doc}
]
build: [
Expand Down