Skip to content

Commit f2b6727

Browse files
authored
Merge pull request #1 from tarides/ci
Add github CI
2 parents 7adbb9c + e74b92a commit f2b6727

File tree

8 files changed

+184
-4
lines changed

8 files changed

+184
-4
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os:
15+
# - ubuntu-latest (already in test)
16+
- macos-latest
17+
# - windows-latest (libmongoc not available through cygwin)
18+
ocaml-compiler:
19+
- 5.3.0
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Setup OCaml ${{ matrix.ocaml-version }}
27+
uses: ocaml/setup-ocaml@v3
28+
with:
29+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
30+
31+
- name: Opam dependencies
32+
run: opam install --deps-only -t .
33+
34+
- name: Runtest
35+
run: opam exec -- dune build @all

.github/workflows/deploy-odoc.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: read-all
9+
10+
concurrency:
11+
group: deploy-odoc
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy-odoc:
16+
name: Deploy odoc to GitHub Pages
17+
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
21+
22+
permissions:
23+
contents: read
24+
id-token: write
25+
pages: write
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout tree
31+
uses: actions/checkout@v4
32+
33+
- name: Set-up OCaml
34+
uses: ocaml/setup-ocaml@v3
35+
with:
36+
ocaml-compiler: "5.3.0"
37+
38+
- name: Install dependencies
39+
run: opam install . --deps-only --with-doc
40+
41+
- name: Build documentation
42+
run: opam exec -- dune build @doc
43+
44+
- name: Set-up Pages
45+
uses: actions/configure-pages@v4
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: _build/default/_doc/_html
51+
52+
- name: Deploy odoc to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
ocaml-compiler:
17+
- 5.3.0
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- name: Install mongosh
23+
run: |
24+
sudo apt-get install -y wget gnupg
25+
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
26+
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
27+
sudo apt-get update
28+
sudo apt-get install -y mongodb-mongosh
29+
30+
- uses: actions/checkout@v2
31+
32+
- name: Setup OCaml ${{ matrix.ocaml-version }}
33+
uses: ocaml/setup-ocaml@v3
34+
with:
35+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
36+
37+
- name: Opam dependencies
38+
run: opam install --deps-only -t .
39+
40+
- name: Start MongoDB
41+
uses: supercharge/[email protected]
42+
with:
43+
mongodb-version: "8.0"
44+
45+
- name: Runtest
46+
run: opam exec -- dune runtest

bin/omont.t

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
$ ./omong.exe list
55
admin.system.version
6-
bitcoin.price_2017_2023
76
config.system.sessions
87
local.startup_log
98

@@ -124,7 +123,6 @@
124123

125124
$ mongosh list.js
126125
admin.system.version
127-
bitcoin.price_2017_2023
128126
config.system.sessions
129127
local.startup_log
130128

conf-libmongoc.opam

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is generated by dune, edit dune-project instead
2+
3+
opam-version: "2.0"
4+
maintainer: "Tarides <[email protected]>"
5+
bug-reports: "https://github.com/ocaml/opam-repository/issues"
6+
authors: ["MongoDB"]
7+
homepage: "https://www.mongodb.com/docs/drivers/c/"
8+
license: "Apache-2.0"
9+
build: ["pkg-config" "libmongoc"]
10+
depends: ["conf-pkg-config" {build}]
11+
depexts: [
12+
["libmongoc-dev"] {os-family = "debian" | os-family = "ubuntu"}
13+
["mongo-c-driver-devel"] {os-distribution = "fedora"}
14+
["mongo-c-driver"] {os-distribution = "arch" | os = "freebsd" | os = "macos"}
15+
["mongo-c-driver-dev"] {os-distribution = "alpine"}
16+
]
17+
synopsis: "Virtual package relying on a libmongoc system installation"
18+
description: "This package can only install if libmongoc is installed on the system."
19+
flags: conf

conf-libmongoc.opam.template

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
opam-version: "2.0"
2+
maintainer: "Tarides <[email protected]>"
3+
bug-reports: "https://github.com/ocaml/opam-repository/issues"
4+
authors: ["MongoDB"]
5+
homepage: "https://www.mongodb.com/docs/drivers/c/"
6+
license: "Apache-2.0"
7+
build: ["pkg-config" "libmongoc"]
8+
depends: ["conf-pkg-config" {build}]
9+
depexts: [
10+
["libmongoc-dev"] {os-family = "debian" | os-family = "ubuntu"}
11+
["mongo-c-driver-devel"] {os-distribution = "fedora"}
12+
["mongo-c-driver"] {os-distribution = "arch" | os = "freebsd" | os = "macos"}
13+
["mongo-c-driver-dev"] {os-distribution = "alpine"}
14+
]
15+
synopsis: "Virtual package relying on a libmongoc system installation"
16+
description: "This package can only install if libmongoc is installed on the system."
17+
flags: conf

dune-project

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
(lang dune 3.16)
2+
23
(using ctypes 0.3)
4+
35
(name mongoc)
6+
47
(generate_opam_files true)
8+
59
(package
610
(name mongoc)
711
(synopsis "OCaml binding of the libmongoc library")
812
(description "OCaml binding of the MongoDB client library for C, libmongoc")
913
(maintainers "Cuihtlauac ALVARADO")
1014
(authors "Cuihtlauac ALVARADO")
11-
(source (github tarides/mongoc-ocaml))
15+
(source
16+
(github tarides/mongoc-ocaml))
1217
(license ISC)
1318
(depends
1419
(dune :build)
1520
(ocamlformat :build)
1621
cmdliner
17-
ctypes))
22+
ctypes
23+
conf-libmongoc))
24+
25+
(package
26+
(name conf-libmongoc)
27+
(allow_empty))

mongoc.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ depends: [
1212
"ocamlformat" {build}
1313
"cmdliner"
1414
"ctypes"
15+
"conf-libmongoc"
1516
"odoc" {with-doc}
1617
]
1718
build: [

0 commit comments

Comments
 (0)