-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(binding/ocaml): init ocaml binding * chore(binding/ocaml): license and ci * chore: license * chore: add readme * chore: update ci * update test file use ounit tempdir * update ci * update ci * fix ci * fix ci * fix ci * fix ci * fix ci * fix ci * fix ci * update ci try use dune cache * update ci * update ci * update ci * update ci * update ci
- Loading branch information
Showing
21 changed files
with
663 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Setup OCaml | ||
description: 'Prepare OCaml Build Environment' | ||
inputs: | ||
need-depext: | ||
description: "Enable the automation feature for opam depext." | ||
need-pin: | ||
description: "Enable the automation feature for opam pin." | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup OCaml | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: 4.14 | ||
opam-depext: ${{inputs.need-depext == true}} | ||
opam-pin: ${{inputs.need-pin == true}} | ||
|
||
- name: Set Opam env | ||
shell: bash | ||
run: opam env | tr '\n' ' ' >> $GITHUB_ENV | ||
- name: Add Opam switch to PATH | ||
shell: bash | ||
run: opam var bin >> $GITHUB_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Bindings OCaml CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "bindings/ocaml/**" | ||
- ".github/workflows/bindings_ocaml.yml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup OCaml toolchain | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
need-depext: true | ||
need-pin: true | ||
|
||
- name: Checks | ||
run: | | ||
# make sure tests pass | ||
opam install -y dune ounit2 ocamlformat | ||
eval $(opam env) | ||
cd bindings/ocaml | ||
dune runtest | ||
dune build @fmt | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_build |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[package] | ||
name = "opendal-ocaml" | ||
publish = false | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true | ||
|
||
[lib] | ||
crate-type = ["staticlib", "cdylib"] | ||
doc = false | ||
|
||
[dependencies] | ||
opendal.workspace = true | ||
ocaml = {version = "^1.0.0-beta"} | ||
|
||
[build-dependencies] | ||
ocaml-build = {version = "^1.0.0-beta"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# OpenDAL OCaml Binding (WIP) | ||
|
||
## Requirements | ||
|
||
* OCaml version > 4.03 and < 5.0.0 | ||
|
||
|
||
## Build | ||
|
||
|
||
|
||
```bash | ||
cd bindings/ocaml | ||
dune build | ||
``` | ||
|
||
## Test | ||
|
||
```bash | ||
cd bindings/ocaml | ||
dune test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
pub fn main() -> std::io::Result<()> { | ||
ocaml_build::Sigs::new("src/opendal.ml").generate() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; Licensed to the Apache Software Foundation (ASF) under one | ||
; or more contributor license agreements. See the NOTICE file | ||
; distributed with this work for additional information | ||
; regarding copyright ownership. The ASF licenses this file | ||
; to you under the Apache License, Version 2.0 (the | ||
; "License"); you may not use this file except in compliance | ||
; with the License. You may obtain a copy of the License at | ||
; | ||
; http://www.apache.org/licenses/LICENSE-2.0 | ||
; | ||
; Unless required by applicable law or agreed to in writing, | ||
; software distributed under the License is distributed on an | ||
; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
; KIND, either express or implied. See the License for the | ||
; specific language governing permissions and limitations | ||
; under the License. | ||
|
||
(dirs :standard \ target) |
Oops, something went wrong.