Skip to content

Commit

Permalink
chore: try to reinforce CI by running integration tests in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jun 7, 2024
1 parent ee1a30d commit f2e90ac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_opam
_build
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ jobs:
allow-prerelease-opam: true
dune-cache: true
#- run: sudo apt install protobuf-compiler libprotobuf-dev
- run: bash dep/build-ci.sh
- run: opam pin -n .
- run: opam depext -yt ocaml-protoc
- run: opam install -t . --deps-only
- run: opam exec -- dune build @install
- run: opam exec -- dune runtest

# integration tests
- run: opam install ppx_deriving -y
- run: sudo apt install protobuf-compiler libprotobuf-dev
- run: opam exec -- make integration PB_LINC=/usr/lib/x86_64-linux-gnu/ PB_HINC=/usr/include/x86_64-linux-gnu/
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: docker build -f dep/Dockerfile . --target=base
- run: docker build -f dep/Dockerfile . --target=run-the-damn-build

format:
name: format
Expand Down
22 changes: 22 additions & 0 deletions dep/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ocaml/opam:debian-ocaml-4.14 AS base

WORKDIR /build/
RUN sudo chown -R opam: /build/
RUN sudo apt install protobuf-compiler libprotobuf-dev -y
COPY --chown=opam ./src/ ./src/
COPY --chown=opam pbrt.opam pbrt_services.opam pbrt_yojson.opam ocaml-protoc.opam \
Makefile Makefile.test dune-project dune .ocamlformat \
.ocamlformat-ignore ./

RUN opam pin -n .
RUN opam depext -yt ocaml-protoc
RUN opam install -t . --deps-only

FROM base AS run-the-damn-build
RUN opam exec -- dune build @install
RUN opam exec -- dune runtest

# integration tests
RUN opam install ppx_deriving -y
RUN opam exec -- make clean build integration PB_LINC=/usr/lib/x86_64-linux-gnu/ PB_HINC=/usr/include/x86_64-linux-gnu/

0 comments on commit f2e90ac

Please sign in to comment.