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
31 changed files
with
5,193 additions
and
36,611 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build and test the project | ||
strategy: | ||
matrix: | ||
system: | ||
- ubuntu-latest | ||
node-version: | ||
- 18.x | ||
ocaml-compiler: | ||
- 5.1.x | ||
|
||
runs-on: ${{ matrix.system }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{matrix.node-version}} | ||
|
||
- name: Use OCaml ${{ matrix.ocaml-compiler }} | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-compiler: ${{ matrix.ocaml-compiler }} | ||
|
||
- name: Install all deps | ||
run: make install | ||
|
||
- name: Build the project | ||
run: make build | ||
|
||
- name: Run tests | ||
run: make test-coverage | ||
|
||
- name: Publish test report to Coveralls | ||
uses: coverallsapp/github-action@v1 |
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,60 @@ | ||
project_name = bs-decode | ||
|
||
DUNE = opam exec -- dune | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: help | ||
help: ## Print this help message | ||
@echo "List of available make commands"; | ||
@echo ""; | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'; | ||
@echo ""; | ||
|
||
.PHONY: create-switch | ||
create-switch: ## Create opam switch | ||
opam switch create . -y --deps-only | ||
|
||
.PHONY: init | ||
init: create-switch install ## Configure everything to develop this repository in local | ||
|
||
.PHONY: install | ||
install: ## Install development dependencies | ||
yarn install ## install JavaScript packages that the project might depend on, like `react` or `react-dom` | ||
opam update ## make sure that opam has the latest information about published libraries in the opam repository https://opam.ocaml.org/packages/ | ||
opam install -y . --deps-only --with-test ## install the Melange and OCaml dependencies | ||
opam pin -y add $(project_name).dev . ## somehow needed to get relude to show up in dune? | ||
opam exec opam-check-npm-deps ## check that the versions of the JavaScript packages installed match the requirements defined by Melange libraries | ||
|
||
.PHONY: build | ||
build: ## Build the project | ||
$(DUNE) build @main | ||
|
||
.PHONY: watch | ||
watch: ## Watch for the filesystem and rebuild on every change | ||
$(DUNE) build --watch @main | ||
|
||
.PHONY: clean | ||
clean: ## Clean build artifacts and other generated files | ||
rm test/output/test/utils/BigJson.json | ||
$(DUNE) clean | ||
|
||
.PHONY: copy-test-json | ||
copy-test-json: ## Copy test json files to the right place | ||
cp test/utils/BigJson.json test/output/test/utils/BigJson.json | ||
|
||
.PHONY: test | ||
test: copy-test-json | ||
yarn test | ||
|
||
.PHONY: test-coverage | ||
test-coverage: copy-test-json | ||
yarn test --coverage | ||
|
||
.PHONY: format | ||
format: ## Format the codebase with ocamlformat | ||
$(DUNE) build @fmt --auto-promote | ||
|
||
.PHONY: format-check | ||
format-check: ## Checks if format is correct | ||
$(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
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,27 @@ | ||
opam-version: "2.0" | ||
synopsis: "BS Decode" | ||
description: "Type-safe JSON decoding for ReasonML and OCaml" | ||
maintainer: ["Michael Martin"] | ||
authors: ["Michael Martin"] | ||
license: "MIT" | ||
homepage: "https://github.com/mlms13/bs-decode" | ||
bug-reports: "https://github.com/mlms13/bs-decode/issues" | ||
depends: [ | ||
"dot-merlin-reader" {dev} | ||
"dune" {>= "3.8"} | ||
"melange" {>= "2.0.0"} | ||
"ocaml" {>= "5.1.0"} | ||
"reason" {>= "3.10.0" & < "4.0.0"} | ||
"ocaml-lsp-server" {dev} | ||
"ocamlformat" {dev} | ||
"odoc" {with-doc} | ||
"relude" {dev} | ||
"bastet" {dev} | ||
"melange-jest" {>= "0.1.0"} | ||
"opam-check-npm-deps" {with-test} | ||
] | ||
|
||
pin-depends: [ | ||
[ "relude.dev" "git+https://github.com/reazen/relude.git#v2" ] | ||
[ "bastet.dev" "git+https://github.com/johnhaley81/bastet.git#6c8f53a9da55254691df49bddf96b279b38be204" ] | ||
] |
This file was deleted.
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
Oops, something went wrong.