Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .drone.yml

This file was deleted.

77 changes: 31 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,42 @@
name: Cstruct
on: [push, pull_request]
jobs:
latest:
name: Latest
runs-on: ${{ matrix.operating-system }}
# cstruct and its runtime siblings build on modern OCaml, including 5.x.
build:
name: ${{ matrix.ocaml-compiler }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ]
operating-system: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
ocaml-compiler:
- "5.3"
- "5.1"
- "4.14"
steps:
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}
- run: opam pin add -n .
- name: Packages
run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt
- name: Build
run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt
ppx:
name: PPX
runs-on: ${{ matrix.operating-system }}
- uses: actions/checkout@v4
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- run: >-
opam install ./cstruct.opam ./cstruct-sexp.opam ./cstruct-unix.opam
./cstruct-lwt.opam --deps-only
- run: opam exec -- dune build -p cstruct,cstruct-sexp,cstruct-unix,cstruct-lwt

# ppx_cstruct (ocaml-migrate-parsetree) and cstruct-async (async) do not build
# on OCaml 5.x, so run the full build and test on 4.14.
test:
name: full build + test (4.14) / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ]
operating-system: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}
- run: opam pin add -n .
- name: Packages
run: opam depext -yt ppx_cstruct
- name: Build
run: opam install -t ppx_cstruct
async:
name: Async
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
ocaml-version: [ '4.13.1', '4.10.0', '4.08.1' ]
operating-system: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}
- run: opam pin add -n .
- name: Packages
run: opam depext -yt cstruct-async
- name: Dependencies
run: opam install -t cstruct-async
- uses: actions/checkout@v4
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"
- run: opam install . --deps-only --with-test
- run: opam exec -- dune build
- run: opam exec -- dune runtest
6 changes: 3 additions & 3 deletions cstruct-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ build: [
depends: [
"ocaml" {>= "4.08.0"}
"dune" {>= "2.0.0"}
"async" {>= "v0.9.0"}
"async_unix" {>= "v0.9.0"}
"core" {>= "v0.9.0"}
"async" {>= "v0.9.0" & < "v0.17.0"}
"async_unix" {>= "v0.9.0" & < "v0.17.0"}
"core" {>= "v0.9.0" & < "v0.17.0"}
"cstruct" {=version}
]
synopsis: "Access C-like structures directly from OCaml"
Expand Down
2 changes: 1 addition & 1 deletion cstruct.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ depends: [
"dune" {>= "2.0.0"}
"alcotest" {with-test}
"fmt" {>= "0.8.9"}
"crowbar" {with-test}
"crowbar" {with-test & >= "0.2"}
]
conflicts: [ "js_of_ocaml" {<"3.5.0"} ]
synopsis: "Access C-like structures directly from OCaml"
Expand Down
14 changes: 7 additions & 7 deletions fuzz/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
(name fuzz)
(libraries cstruct bigarray cstruct-sexp crowbar fmt))

; The fuzzer is afl-only (see fuzz.ml): its generators are unbounded, so
; quickcheck mode hangs. Build it under runtest as a compile check; run the
; campaign with an afl-instrumented switch and afl-fuzz on fuzz.exe.

(rule
(alias fuzz)
(deps
fuzz.exe
(source_tree input))
(action
(run timeout --preserve-status 30m bun -v --input=input --output=output --
./fuzz.exe)))
(alias runtest)
(deps fuzz.exe)
(action (progn)))
Loading