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 335e38e commit 850ecf7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
44 changes: 43 additions & 1 deletion .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 Down Expand Up @@ -44,3 +44,45 @@ jobs:
name: Test and coverage report
command: |
opam config exec -- make coverage TOKEN=$COVERALLS_REPO_TOKEN
# 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: |
for p in pgx pgx_lwt; do
opam pin add -y -n ${p%.opam} .
done
- run:
name: Install OCaml dependencies
command: opam install --deps-only -y pgx pgx_lwt
- run:
name: Install mirage
command: opam install -y mirage
- run:
name: Configure mirage
command: cd mirage && mirage configure -t xen
- run:
name: Install mirage deps
command: cd mirage && make depend
- run:
name: Build mirage
command: cd mirage && 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_lwt" ] "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 850ecf7

Please sign in to comment.