Skip to content

Commit

Permalink
Add Mirage build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanlong committed Apr 27, 2020
1 parent 66596db commit f4714c6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1
jobs:
build:
docker:
Expand All @@ -25,7 +25,7 @@ jobs:
name: Pin packages
command: |
for p in *.opam; do
opam pin add -y -n ${p%.opam} .
opam pin add -k git -y -n ${p%.opam} .
done
- run:
name: Install system dependencies
Expand All @@ -44,3 +44,45 @@ jobs:
name: Test and coverage report
command: |
opam config exec -- make coverage
# This build step ensures we can build a mirage unikernel but doesn't make any attempt to run it
# We're basically just trying to ensure our build deps are ok
build_mirage:
docker:
- image: ocaml/opam2:4.09
environment:
TERM: xterm
steps:
- checkout
- run:
name: Update opam
command: |
opam remote remove default --all
opam remote add default https://opam.ocaml.org
- run:
name: Pin packages
command: opam pin add -k git -y -n pgx .
- run:
name: Install system dependencies
command: opam depext -y pgx
- run:
name: Install OCaml dependencies
command: opam install --deps-only -y pgx
- run:
name: Install mirage
command: opam install -y mirage
- run:
name: Configure mirage
command: cd mirage && opam exec -- mirage configure -t spt
- run:
name: Install mirage deps
command: cd mirage && opam exec -- make depend
- run:
name: Build mirage
command: cd mirage && opam exec -- make

workflows:
main:
jobs:
- build
- build_mirage
4 changes: 4 additions & 0 deletions mirage/config.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
open Mirage

let main = foreign ~packages:[ package "pgx" ] "Unikernel" job
let () = register "hello" [ main ]
1 change: 1 addition & 0 deletions mirage/unikernel.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let start = Lwt.return_unit

0 comments on commit f4714c6

Please sign in to comment.