-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,193 additions
and
3 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
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,40 @@ | ||
name: build | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
- windows-latest | ||
ocaml-compiler: | ||
- 4.14.0 | ||
include: | ||
- os: ubuntu-latest | ||
ocaml-compiler: 4.03.0 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: setup-ocaml | ||
uses: avsm/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: ${{ matrix.ocaml-compiler }} | ||
- name: setup | ||
run: | | ||
opam pin add . -y --no-action | ||
opam depext -y swhid_core | ||
opam install -y ./*.opam --deps-only --with-test | ||
opam upgrade --fixup | ||
- name: build | ||
run: opam exec -- dune build @install | ||
- name: test | ||
run: opam exec -- dune runtest |
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,36 @@ | ||
name: deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
persist-credentials: false | ||
- name: setup-ocaml | ||
uses: avsm/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: 4.12.0 | ||
- name: setup-deploy | ||
run: | | ||
opam pin add . -y --no-action | ||
opam depext -y swhid_core | ||
opam install -y ./*.opam --deps-only --with-test --with-doc | ||
opam upgrade --fixup | ||
touch doc/.nojekyll | ||
- name: api | ||
run: | | ||
opam exec -- dune build @doc | ||
mv _build/default/_doc/_html/ doc/api | ||
- name: deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: doc/ | ||
CLEAN: true |
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 |
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,42 @@ | ||
version=0.21.0 | ||
assignment-operator=end-line | ||
break-cases=fit | ||
break-fun-decl=wrap | ||
break-fun-sig=wrap | ||
break-infix=wrap | ||
break-infix-before-func=false | ||
break-separators=before | ||
break-sequences=true | ||
cases-exp-indent=2 | ||
cases-matching-exp-indent=normal | ||
doc-comments=before | ||
doc-comments-padding=2 | ||
doc-comments-tag-only=default | ||
dock-collection-brackets=false | ||
exp-grouping=preserve | ||
field-space=loose | ||
if-then-else=compact | ||
indicate-multiline-delimiters=space | ||
indicate-nested-or-patterns=unsafe-no | ||
infix-precedence=indent | ||
leading-nested-match-parens=false | ||
let-and=sparse | ||
let-binding-spacing=compact | ||
let-module=compact | ||
margin=80 | ||
max-indent=68 | ||
module-item-spacing=sparse | ||
ocp-indent-compat=false | ||
parens-ite=false | ||
parens-tuple=always | ||
parse-docstrings=true | ||
sequence-blank-line=preserve-one | ||
sequence-style=terminator | ||
single-case=compact | ||
space-around-arrays=true | ||
space-around-lists=true | ||
space-around-records=true | ||
space-around-variants=true | ||
type-decl=sparse | ||
wrap-comments=false | ||
wrap-fun-args=true |
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,3 @@ | ||
## 0.1 - 2022-06-20 | ||
|
||
- first release |
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,8 @@ | ||
The ISC License (ISC) | ||
===================== | ||
|
||
Copyright © 2022, OCamlPro <[email protected]> | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
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,39 @@ | ||
# swhid_core | ||
|
||
[swhid_core] is an [OCaml] library to work with [persistent identifiers] used by [Software Heritage], also known as swhid. This is the core library, for most use cases you should use the [swhid library] instead. | ||
|
||
## Installation | ||
|
||
`swhid_core` can be installed with [opam]: | ||
|
||
```sh | ||
opam install swhid_core | ||
``` | ||
|
||
If you don't have `opam`, you can install it following the [how to install opam] guide. | ||
|
||
If you can't or don't want to use `opam`, consult the [opam file] for build instructions. | ||
|
||
## Quickstart | ||
|
||
Have a look at the [example] folder or at the [documentation]. | ||
|
||
## About | ||
|
||
- [LICENSE] | ||
- [CHANGELOG] | ||
|
||
[CHANGELOG]: ./CHANGES.md | ||
[example]: ./example | ||
[LICENSE]: ./LICENSE.md | ||
[opam file]: ./swhid_core.opam | ||
[test suite]: ./test | ||
|
||
[documentation]: https://ocamlpro.github.io/swhid_core/api/swhid_core/ | ||
[how to install opam]: https://opam.ocaml.org/doc/Install.html | ||
[OCaml]: https://ocaml.org | ||
[opam]: https://opam.ocaml.org/ | ||
[persistent identifiers]: https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html | ||
[Software Heritage]: https://www.softwareheritage.org | ||
[swhid library]: https://github.com/OCamlPro/swhid | ||
[swhid_core]: https://github.com/OCamlPro/swhid_core |
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,3 @@ | ||
(documentation | ||
(package swhid_core) | ||
(mld_files index)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>swhid_core</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<link rel="icon" type="image/png" sizes="804x804" href="favicon.png"> | ||
</head> | ||
<body> | ||
<div class="content"> | ||
<div class="header"> | ||
<h1>swhid_core</h1> | ||
|
||
<p>swhid_core is an <a href="https://ocaml.org">OCaml</a> library to work with <a href="https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html">persistent identifiers</a> found in <a href="https://www.softwareheritage.org">Software Heritage identifiers</a>, also known as swhid.</p> | ||
</div> | ||
|
||
<div class="section"> | ||
<ul> | ||
<li> | ||
<a href="https://github.com/OCamlPro/swhid_core">Project on Github</a> | ||
</li> | ||
|
||
<li> | ||
<a href="api/swhid_core/">API Documentation</a> | ||
</li> | ||
|
||
<li> | ||
<a href="coverage">Code coverage report</a> | ||
</li> | ||
|
||
<li> | ||
<a href="https://github.com/OCamlPro/swhid_core/issues">Bug reports</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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,9 @@ | ||
{0 swhid_core} | ||
|
||
{{:https://github.com/OCamlPro/swhid_core} swhid_core} is an {{:https://ocaml.org} OCaml} library to work with Software Heritage persistent identifiers (swhids). | ||
|
||
{1:api API} | ||
|
||
{!modules: | ||
Swhid_core | ||
} |
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 @@ | ||
body { | ||
color: #444; | ||
background-color: #EEEEEE; | ||
line-height:1.6; | ||
font-size:18px; | ||
} | ||
.content { | ||
width: 80%; | ||
margin-left: 100px; | ||
margin-top: 100px; | ||
font-family: sans-serif; | ||
} | ||
a:link{ | ||
color:#5bf | ||
} | ||
a:visited{ | ||
color:#55f | ||
} |
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 @@ | ||
(lang dune 1.11) | ||
|
||
(explicit_js_mode) | ||
|
||
(implicit_transitive_deps false) | ||
|
||
(name swhid_core) | ||
|
||
(license ISC) | ||
|
||
(authors | ||
"Léo Andrès <[email protected]>, Dario Pinto <[email protected]>") | ||
|
||
(maintainers "Léo Andrès <[email protected]>") | ||
|
||
(source | ||
(github ocamlpro/swhid_core)) | ||
|
||
(generate_opam_files true) | ||
|
||
(package | ||
(name swhid_core) | ||
(synopsis "OCaml library to work with swhids.") | ||
(description | ||
"swhid_core is an OCaml library to with with Software Heritage persistent identifiers (swhids). This is the core library, for most use cases you should use the swhid library instead.") | ||
(tags | ||
(swhid_core | ||
swhid | ||
swh | ||
persistent | ||
identifiers | ||
hash | ||
software | ||
heritage | ||
archive)) | ||
(depends | ||
(ocaml | ||
(>= 4.03)) | ||
(dune | ||
(>= 1.11)) | ||
(odoc :with-doc))) |
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,4 @@ | ||
(executable | ||
(name main) | ||
(modules main) | ||
(libraries swhid_core)) |
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,10 @@ | ||
open Swhid_core | ||
|
||
let swhid = | ||
match | ||
Object.of_string "swh:1:cnt:bac494ecb6840e6b66f21aae7feb847b23f0745a" | ||
with | ||
| Error e -> | ||
Format.eprintf "error: %s@." e; | ||
exit 1 | ||
| Ok id -> Format.printf "%a is a valid swhid !@." Object.pp id |
Oops, something went wrong.