From b15f976e81f0a6d4740fc11935addb5407267342 Mon Sep 17 00:00:00 2001 From: Fredrik Skold Date: Sun, 19 Jul 2020 20:07:40 +0200 Subject: [PATCH] Update CI and docker images when reverting cmake (#177, #176) --- .dockerignore | 3 ++ .github/workflows/ccpp.yml | 56 ++++++++++++++++++++++++++++++++++++++ Dockerfile.debian | 14 ++++++++++ Dockerfile.test | 18 ++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 .github/workflows/ccpp.yml create mode 100644 Dockerfile.debian create mode 100644 Dockerfile.test diff --git a/.dockerignore b/.dockerignore index caa4fdd8..b0df6a94 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ /_build /build +.git +.github +Dockerfile* diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml new file mode 100644 index 00000000..6f88d038 --- /dev/null +++ b/.github/workflows/ccpp.yml @@ -0,0 +1,56 @@ +name: libmbus + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: build examples and tests + run: | + ./build.sh + cd test && make + cd .. + + - name: generate test frames + run: | + PROG=test/mbus_parse_hex + ./test/generate-xml.sh test/test-frames $PROG + echo "NOTE: error-frames have about 30 parse errors, and unsupported-frames have 12" + ./test/generate-xml.sh test/error-frames $PROG || true + ./test/generate-xml.sh test/unsupported-frames $PROG || true + + - name: install and run gcovr + run: sudo pip install gcovr && gcovr . + + debian: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: install packages + run: | + sudo apt update -y && sudo apt install -y devscripts dpkg-dev fakeroot + - name: build debian package + run: | + ./build-deb.sh + sudo dpkg -i *.deb + ls /usr/lib + +# doc: +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v2 +# - name: build doxygen documentation +# run: sudo apt install -y doxygen +# +# - name: build doxygen documentation +# run: | +# rm -rf build || true +# mkdir build +# cd build +# cmake .. -DLIBMBUS_BUILD_DOCS=ON +# cmake --build . --target doc diff --git a/Dockerfile.debian b/Dockerfile.debian new file mode 100644 index 00000000..5923f001 --- /dev/null +++ b/Dockerfile.debian @@ -0,0 +1,14 @@ +# docker build . -f Dockerfile.deb -t deb_builder + +FROM ubuntu + +RUN apt update -y && apt install -y gcc g++ make && \ + apt-get install -y autoconf libtool +# What package is debuild +RUN apt-get install -y gnupg dput dh-make devscripts lintian +COPY . /tmp +RUN cd /tmp && \ + ./build-deb.sh && \ + ls -al . .. && \ + cd .. && \ + dpkg -i *.deb || true diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 00000000..3e5d1834 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,18 @@ +# docker build . -f Dockerfile.test -t test_builder + +FROM ubuntu + +RUN apt update -y && \ + apt install -y gcc g++ make && \ + apt-get install -y autoconf libtoolw +COPY . /tmp +RUN cd /tmp && \ + ./build.sh && \ + cd test && \ + make && \ + ./generate-xml.sh test-frames/ ./mbus_parse_hex + +RUN cd /tmp && \ + echo "NOTE: error-frames have about 30 parse errors, and unsupported-frames have 12" && \ + ./test/generate-xml.sh test/error-frames || true ; \ + ./test/generate-xml.sh test/unsupported-frames || true