Skip to content

Commit

Permalink
Some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro committed Jul 24, 2019
1 parent bd3f961 commit f5ab7cb
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 18 deletions.
64 changes: 63 additions & 1 deletion .github/actions/build-base/Dockerfile
@@ -1,13 +1,35 @@
FROM debian:10
RUN apt-get update && apt-get install -y \
binutils-mingw-w64-i686 \
build-essential \
check \
cmake \
debhelper \
fakeroot \
g++ \
g++-multilib \
gcc \
gcc-mingw-w64-i686 \
gcc-mingw-w64-x86-64 \
git \
graphviz \
latexmk \
make \
mingw-w64 \
musl-dev \
pkg-config \
python \
py-pip \
python-pip \
python-sphinx \
python3 \
python3-pip \
python3-sphinx \
texinfo \
texlive-fonts-recommended \
texlive-generic-extra \
texlive-latex-extra \
valgrind \
wget \
&& rm -rf /var/cache/apk/*

LABEL "com.github.actions.name"="open62541 build base"
Expand All @@ -18,3 +40,43 @@ LABEL "com.github.actions.color"="purple"
LABEL "repository"="http://github.com/open62541/open62541"
LABEL "homepage"="http://open62541.org"
LABEL "maintainer"="Pro <pro@users.github.com>"

# Install specific tcc version
RUN mkdir tcc_install && \
cd tcc_install && \
wget -nv https://mirror.netcologne.de/savannah/tinycc/tcc-0.9.27.tar.bz2 && \
tar xf tcc-0.9.27.tar.bz2 && \
cd tcc-0.9.27 && \
./configure && \
make && \
make install && \
cd ../.. && \
rm -rf tcc_install

# Install specific mbedtls version
RUN mkdir mbedtls_install && \
cd mbedtls_install && \
wget -nv https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.7.1.tar.gz && \
tar xf mbedtls-2.7.1.tar.gz && \
cd mbedtls-mbedtls-2.7.1 && \
cmake -DENABLE_TESTING=Off -DCMAKE_INSTALL_PREFIX=$LOCAL_PKG . && \
make -j && \
make install && \
cd ../.. && \
rm -rf mbedtls_install

# Install required python packages

RUN pip install --user cpp-coveralls
# Pin docutils to version smaller 0.15. Otherwise we run into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839299
RUN pip install --user 'docutils<=0.14'
RUN pip install --user sphinx_rtd_theme
RUN pip install --user cpplint

RUN pip3 install --user cpp-coveralls
# Pin docutils to version smaller 0.15. Otherwise we run into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839299
RUN pip3 install --user 'docutils<=0.14'
RUN pip3 install --user sphinx_rtd_theme
RUN pip3 install --user cpplint

RUN export PATH=/root/.local/bin:$PATH
10 changes: 10 additions & 0 deletions .github/actions/build_debian_package.sh
@@ -0,0 +1,10 @@
#!/bin/sh

set -eu

echo -e "== Building the Debian package =="
dpkg-buildpackage -b
if [ $? -ne 0 ] ; then exit 1 ; fi
cp ../open62541*.deb .
# Copy for github release script
cp ../open62541*.deb ../..
6 changes: 4 additions & 2 deletions .github/actions/build_full_ns0.sh
Expand Up @@ -2,8 +2,10 @@

set -eu

echo -e "\r\n== Unit tests (full NS0) =="
mkdir -p build && cd build
build_dir=build-full-ns0-$PYTHON

echo -e "== Build (full NS0) =="
mkdir -p $build_dir && cd $build_dir

# Valgrind cannot handle the full NS0 because the generated file is too big. Thus run NS0 full without valgrind
cmake \
Expand Down
47 changes: 32 additions & 15 deletions .github/main.workflow
@@ -1,27 +1,44 @@
workflow "Build and Deploy" {
on = "push"
resolves = ["Build"]
on = "push"
resolves = ["Build"]
}


action "Init Submodules" {
needs = "Init Submodules"
uses = "./.github/actions/build-base"
runs = ["git submodule sync && git submodule update --init --recursive"]
action "Init: Submodules" {
uses = "./.github/actions/build-base"
runs = "sh -c"
args = ["git submodule sync && git submodule update --init --recursive"]
}

action "Build Full NS0" {
needs = "Init Submodules"
uses = "./.github/actions/build-base"
runs = ["./.github/actions/build_full_ns0.sh"]
action "Build: Full NS0 (Python2)" {
needs = "Init: Submodules"
uses = "./.github/actions/build-base"
runs = "sh -c"
args = ["export PYTHON=python2 && ./.github/actions/build_full_ns0.sh"]
}

action "Unit Test Full NS0" {
needs = "Build Full NS0"
uses = "./.github/actions/build-base"
runs = ["cd build && make test"]
action "Build: Full NS0" {
needs = "Init: Submodules"
uses = "./.github/actions/build-base"
runs = "sh -c"
args = ["export PYTHON=python3 && ./.github/actions/build_full_ns0.sh"]
}

action "Test: Full NS0" {
needs = ["Build: Full NS0 (Python2)", "Build: Full NS0"]
uses = "./.github/actions/build-base"
runs = "sh -c"
args = ["cd build-full-ns0-python3 && make test"]
}

action "Test: Debian Packaging" {
needs = "Init: Submodules"
uses = "./.github/actions/build-base"
runs = "sh -c"
args = ["export PYTHON=python2 && ./.github/actions/build_debian_package.sh"]
}

action "Build" {
needs = ["Unit Test Full NS0"]
uses = "./.github/actions/build-base"
needs = ["Test: Full NS0"]
}

0 comments on commit f5ab7cb

Please sign in to comment.