Skip to content

Commit

Permalink
fix(ci): run ci on dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
caballa committed Sep 21, 2023
1 parent 26dacab commit 146f539
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 24 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/nightly-crab-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,22 @@ jobs:
uses: actions/checkout@v2
with:
ref: master
- name: Build crab without external libraries + run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile .
#- name: Build crab without external libraries + run tests
# run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Coverage -t seahorn/crab:bionic -f docker/crab.Dockerfile .
#- name: Build crab without external libraries for coverage
# run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Coverage -t seahorn/crab:nightly -f docker/crab.Dockerfile .
#- name: Generate coverage report and upload to codecov
# run: docker run -v $(pwd):/host -it seahorn/crab:bionic /bin/sh -c "bash /crab/tests/run_coverage.sh /crab/build /crab && mv /crab/build/all.info /host" && bash <(curl -s https://codecov.io/bash) -Z -f all.info -t ${{ secrets.CODECOV_TOKEN }}
# run: docker run -v $(pwd):/host -it seahorn/crab:nightly /bin/sh -c "bash /crab/tests/run_coverage.sh /crab/build /crab && mv /crab/build/all.info /host" && bash <(curl -s https://codecov.io/bash) -Z -f all.info -t ${{ secrets.CODECOV_TOKEN }}
- name: Build crab without external libraries + run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:nightly -f docker/crab.Dockerfile .
- name: Build crab+apron+ldd-boxes and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile .
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:nightly -f docker/crab.apron.Dockerfile .
- name: Build crab+elina and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile .
#- name: Build crab+pplite and run tests
# run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_pplite:bionic -f docker/crab.pplite.Dockerfile .
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:nightly -f docker/crab.elina.Dockerfile .
- name: Login to DockerHub Registry
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Tag and push crab (nightly) to DockerHub
if: ${{ github.event_name == 'schedule' }} # only push if nightly run
run: |
docker push seahorn/crab:bionic
docker push seahorn/crab_apron_boxes:bionic
docker push seahorn/crab_elina:bionic
#docker push seahorn/crab_pplite:bionic
docker push seahorn/crab:nightly
docker push seahorn/crab_apron_boxes:nightly
docker push seahorn/crab_elina:nightly
6 changes: 3 additions & 3 deletions .github/workflows/test-crab-dev-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
ref: dev
- name: Build crab without external libraries + run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile .
run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.dev.Dockerfile .
- name: Build crab+apron+ldd-boxes and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile .
run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes -f docker/crab.dev.apron.Dockerfile .
- name: Build crab+elina and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile .
run: docker build --build-arg BUILD_TYPE=Release -t seahorn/crab_elina -f docker/crab.dev.elina.Dockerfile .
6 changes: 3 additions & 3 deletions .github/workflows/test-crab-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
ref: master
- name: Build crab without external libraries + run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile .
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.Dockerfile .
- name: Build crab+apron+ldd-boxes and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes:bionic -f docker/crab.apron.Dockerfile .
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_apron_boxes -f docker/crab.apron.Dockerfile .
- name: Build crab+elina and run tests
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina:bionic -f docker/crab.elina.Dockerfile .
run: docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab_elina -f docker/crab.elina.Dockerfile .
2 changes: 1 addition & 1 deletion docker/buildpack-deps-crab.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Dockerfile for building Crab dependencies.
# Dockerfile for building Crab dependencies for Ubuntu xenial and bionic.
#
# Arguments:
# - UBUNTU: xenial, bionic
Expand Down
18 changes: 18 additions & 0 deletions docker/buildpack-deps-crab.jammy.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Dockerfile for building Crab dependencies for Ubuntu 22.04 jammy
#

# Pull base image.
FROM buildpack-deps:jammy

RUN apt-get update && \
apt-get install -yqq software-properties-common && \
apt-get install -yqq build-essential && \
add-apt-repository -y ppa:mhier/libboost-latest && \
apt-get update && \
apt-get install -yqq cmake cmake-data \
ninja-build \
g++-12 \
libboost1.74-dev libboost-program-options1.74-dev \
libgmp-dev libmpfr-dev libflint-dev

29 changes: 29 additions & 0 deletions docker/crab.dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Dockerfile for Crab image without external libraries.
#
# Pull base image.
FROM seahorn/buildpack-deps-crab:jammy

# Assume that docker-build is ran in the top-level Crab directory
COPY . /crab
# Re-create the build directory that might have been present in the source tree
RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build

WORKDIR /crab/build

ARG BUILD_TYPE
# Build configuration.
RUN cmake -GNinja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=run \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCRAB_ENABLE_TESTS=ON \
../ && \
cmake --build . --target install

# Run tests
RUN /crab/tests/run_tests.sh /crab/tests/expected_results.out /crab/build

WORKDIR /crab

34 changes: 34 additions & 0 deletions docker/crab.dev.apron.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Dockerfile for Crab image with apron and boxes libraries.
#

# Pull base image.
FROM seahorn/buildpack-deps-crab:jammy

# Assume that docker-build is ran in the top-level Crab directory
COPY . /crab
# Re-create the build directory that might have been present in the source tree
RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build
WORKDIR /crab/build

ARG BUILD_TYPE
# Build configuration.
RUN cmake -GNinja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=run \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCRAB_USE_LDD=ON \
-DCRAB_USE_APRON=ON \
-DCRAB_ENABLE_TESTS=ON \
../ && \
cmake --build . --target ldd && cmake .. && \
cmake --build . --target apron && cmake .. && \
cmake --build . --target install

# Run tests
RUN /crab/tests/run_tests.sh /crab/tests/expected_results.apron.out /crab/build
RUN /crab/tests/run_tests.sh /crab/tests/expected_results.boxes.out /crab/build

WORKDIR /crab

34 changes: 34 additions & 0 deletions docker/crab.dev.elina.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Dockerfile for Crab image with elina library.
#

# Pull base image.
FROM seahorn/buildpack-deps-crab:jammy

# Assume that docker-build is ran in the top-level Crab directory
COPY . /crab
# Re-create the build directory that might have been present in the source tree
RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build
WORKDIR /crab/build

ARG BUILD_TYPE
# Build configuration.
RUN cmake -GNinja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=run \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCRAB_USE_ELINA=ON \
-DCRAB_ENABLE_TESTS=ON \
../ && \
cmake --build . --target elina && cmake .. && \
cmake --build . --target install

# To find elina dynamic libraries
ENV LD_LIBRARY_PATH "/crab/build/run/elina/lib:$LD_LIBRARY_PATH"

# Run tests
RUN /crab/tests/run_tests.sh /crab/tests/expected_results.elina.out /crab/build

WORKDIR /crab

32 changes: 32 additions & 0 deletions docker/crab.dev.pplite.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Dockerfile for Crab image with pplite library.
#

# Pull base image.
FROM seahorn/buildpack-deps-crab:jammy

# Assume that docker-build is ran in the top-level Crab directory
COPY . /crab
# Re-create the build directory that might have been present in the source tree
RUN rm -rf /crab/build /crab/debug /crab/release && mkdir /crab/build
WORKDIR /crab/build

ARG BUILD_TYPE
# Build configuration.
RUN cmake -GNinja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=run \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCRAB_USE_APRON=ON -DCRAB_USE_PPLITE=ON \
-DCRAB_ENABLE_TESTS=ON \
../ && \
cmake --build . --target apron && cmake .. && \
cmake --build . --target pplite && cmake .. && \
cmake --build . --target pplite_domains

# Run tests
RUN /crab/tests/run_tests.sh /crab/tests/expected_results.pplite.out /crab/build

WORKDIR /crab

12 changes: 8 additions & 4 deletions docker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@


```shell
$ docker build --build-arg UBUNTU=bionic -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.Dockerfile .
$ docker build -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.Dockerfile .
$ docker push seahorn/buildpack-deps-crab:bionic
```
or

```shell
$ docker build -t seahorn/buildpack-deps-crab:bionic -f docker/buildpack-deps-crab.jammy.Dockerfile .
$ docker push seahorn/buildpack-deps-crab:jammy
```

# Building Docker image for Crab and running tests #

```shell
docker build --build-arg UBUNTU=bionic --build-arg BUILD_TYPE=Release -t seahorn/crab:bionic -f docker/crab.Dockerfile .
docker run -v `pwd`:/host -it seahorn/crab:bionic
docker build --build-arg BUILD_TYPE=Release -t seahorn/crab -f docker/crab.Dockerfile .
docker run -v `pwd`:/host -it seahorn/crab:latest
```

This will automatically download all dependencies from a base image
Expand All @@ -20,6 +25,5 @@ and build Crab under `/crab/build`.
Crab's install directory is added to `PATH`.

Build arguments (required):
- UBUNTU: xenial, bionic
- BUILD_TYPE: Release, Debug

0 comments on commit 146f539

Please sign in to comment.