Skip to content

Commit ecfe257

Browse files
authored
Replace Travis CI with Github Action-based CI. (#14)
Also update README and metadata files.
1 parent 8adf06c commit ecfe257

File tree

7 files changed

+89
-79
lines changed

7 files changed

+89
-79
lines changed

.github/workflows/ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build and test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
# Prime the caches every Monday
10+
- cron: 0 1 * * MON
11+
12+
permissions: read-all
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-latest, ubuntu-latest]
20+
ocaml-compiler: [5.0, 4.14, 4.8]
21+
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- name: Checkout tree
26+
uses: actions/checkout@v3
27+
28+
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
29+
uses: ocaml/setup-ocaml@v2
30+
with:
31+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
32+
33+
- run: opam install . --deps-only --with-test --with-doc
34+
35+
- run: opam exec -- dune build
36+
37+
- run: opam exec -- dune runtest

README.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*For an older version of this repository based on sedlex, refer to the [sedlex branch](../../tree/sedlex)*.
22

3-
# Nice Parser [![Build Status](https://travis-ci.org/smolkaj/nice-parser.svg?branch=master)](https://travis-ci.org/smolkaj/nice-parser)
3+
# Nice Parser
4+
5+
[![Build Status](https://github.com/smolkaj/nice-parser/workflows/build%20and%20test/badge.svg?branch=master)](https://github.com/smolkaj/nice-parser/actions)
46

57
Writing an OCaml parser with nice error messages should be easy - and now it is!
68
*Nice Parser* comes in two parts:
@@ -14,11 +16,11 @@ In types: `Nice_parser.Make : functor(P : RAW_PARSER) -> NICE_PARSER`.
1416

1517
Using the library and the skeleton, you can get started on your own parser in seconds:
1618
```sh
17-
opam install nice_parser ppx_jane # install nice_parser and ppx_driver
18-
git clone https://github.com/smolkaj/nice-parser.git # clone this repository
19-
cd nice-parser && rm -r lib && mv example src # use example as starting point
20-
dune build src/example.a # try to build...
21-
dune exec src/bin/main.exe # ...and run your parser!
19+
git clone https://github.com/smolkaj/nice-parser.git # clone this repository
20+
cd nice-parser && rm -r lib && mv example src # use example as starting point
21+
opam install . --deps-only --with-test # install dependencies
22+
dune build # try to build...
23+
dune exec src/bin/main.exe # ...and run your parser!
2224
```
2325
You should see the following output (the error message relies on OCaml >= 4.08's new [source highlighting mechanism](https://github.com/ocaml/ocaml/pull/2096)):
2426
```
@@ -45,9 +47,13 @@ The [example skeleton](example) should be self-explanatory.
4547

4648
## How to build
4749
Ideally, use OCaml 4.08 or higher (for [beautiful error messages](https://github.com/ocaml/ocaml/pull/2096)).
50+
All required dependencies can be installed using the [opam](http://opam.ocaml.org) package manager.
4851
The project can be built using [dune](https://dune.build).
49-
Consult the [dune-project file](dune-project) for the necessary dependencies;
50-
all of them can be installed using the [opam](http://opam.ocaml.org) package manager.
52+
```
53+
opam install . --deps-only --with-test
54+
dune build
55+
dune runtest
56+
```
5157

5258
## Suggestions and Improvements
5359
Suggestions and changes are welcome. Please submit pull requests, or open issues.

ci/travis.docgen.sh

-34
This file was deleted.

ci/travis.test.sh

-11
This file was deleted.

dune-project

+30-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
(lang dune 1.10)
2+
23
(using menhir 2.0)
4+
35
(generate_opam_files true)
46

57
(name nice_parser)
8+
69
(version 1.0.0)
10+
711
(license MIT)
8-
(source (github smolkaj/ocaml-parsing))
9-
(authors "Steffen Smolka <[email protected]>")
10-
(maintainers "Steffen Smolka <[email protected]>")
11-
(documentation "https://smolkaj.github.io/ocaml-parsing/nice_parser/")
12+
13+
(source
14+
(github smolkaj/nice-parser))
15+
16+
(authors "Steffen Smolka <[email protected]>")
17+
18+
(maintainers "Steffen Smolka <[email protected]>")
19+
20+
(documentation "https://smolkaj.github.io/nice-parser/nice_parser/")
1221

1322
(package
14-
(name nice_parser)
15-
(synopsis "Nice parsers without the boilerplate")
16-
(description "Nice_parser wraps your {menhir, ocamlyacc}-generated parser in a sane interface, eliminating boilerplate code.")
17-
(depends
18-
(ocaml (>= 4.05.0))
19-
(dune (and :build (>= 1.10)))
20-
(stdio (<> 0))
21-
(base :with-test)
22-
(menhir :with-test)
23-
(ppx_jane :with-test)
24-
(odoc :with-doc)
25-
)
26-
)
23+
(name nice_parser)
24+
(synopsis "Nice parsers without the boilerplate")
25+
(description
26+
"Nice_parser wraps your {menhir, ocamlyacc}-generated parser in a sane interface, eliminating boilerplate code.")
27+
(depends
28+
(ocaml
29+
(>= 4.08.0))
30+
(dune
31+
(and
32+
:build
33+
(>= 1.10)))
34+
(stdio
35+
(<> 0))
36+
(base :with-test)
37+
(menhir :with-test)
38+
(ppx_jane :with-test)
39+
(odoc :with-doc)))

lib/dune

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
(library
2-
(public_name nice_parser)
3-
(libraries stdio compiler-libs.common)
4-
)
2+
(public_name nice_parser)
3+
(libraries stdio compiler-libs.common))

nice_parser.opam

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ build: [
66
["dune" "runtest" "-p" name "-j" jobs] {with-test}
77
["dune" "build" "-p" name "@doc"] {with-doc}
88
]
9-
maintainer: ["Steffen Smolka <smolka@cs.cornell.edu>"]
10-
authors: ["Steffen Smolka <smolka@cs.cornell.edu>"]
11-
bug-reports: "https://github.com/smolkaj/ocaml-parsing/issues"
12-
homepage: "https://github.com/smolkaj/ocaml-parsing"
13-
doc: "https://smolkaj.github.io/ocaml-parsing/nice_parser/"
9+
maintainer: ["Steffen Smolka <steffen.smolka@gmail.com>"]
10+
authors: ["Steffen Smolka <steffen.smolka@gmail.com>"]
11+
bug-reports: "https://github.com/smolkaj/nice-parser/issues"
12+
homepage: "https://github.com/smolkaj/nice-parser"
13+
doc: "https://smolkaj.github.io/nice-parser/nice_parser/"
1414
license: "MIT"
1515
version: "1.0.0"
16-
dev-repo: "git+https://github.com/smolkaj/ocaml-parsing.git"
16+
dev-repo: "git+https://github.com/smolkaj/nice-parser.git"
1717
synopsis: "Nice parsers without the boilerplate"
1818
description:
1919
"Nice_parser wraps your {menhir, ocamlyacc}-generated parser in a sane interface, eliminating boilerplate code."

0 commit comments

Comments
 (0)