Some more tests

This commit is contained in:
Stefan Profanter 2019-07-24 13:26:29 +02:00
parent bd3f9618c1
commit f5ab7cb4ed
No known key found for this signature in database
GPG Key ID: 52787A8E77301854
4 changed files with 109 additions and 18 deletions

View File

@ -1,13 +1,35 @@
FROM debian:10 FROM debian:10
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
binutils-mingw-w64-i686 \
build-essential \
check \
cmake \ cmake \
debhelper \
fakeroot \
g++ \ g++ \
g++-multilib \
gcc \ gcc \
gcc-mingw-w64-i686 \
gcc-mingw-w64-x86-64 \
git \ git \
graphviz \
latexmk \
make \ make \
mingw-w64 \
musl-dev \ musl-dev \
pkg-config \
python \ 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/* && rm -rf /var/cache/apk/*
LABEL "com.github.actions.name"="open62541 build base" LABEL "com.github.actions.name"="open62541 build base"
@ -18,3 +40,43 @@ LABEL "com.github.actions.color"="purple"
LABEL "repository"="http://github.com/open62541/open62541" LABEL "repository"="http://github.com/open62541/open62541"
LABEL "homepage"="http://open62541.org" LABEL "homepage"="http://open62541.org"
LABEL "maintainer"="Pro <pro@users.github.com>" 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
.github/actions/build_debian_package.sh vendored Executable file
View File

@ -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 ../..

View File

@ -2,8 +2,10 @@
set -eu set -eu
echo -e "\r\n== Unit tests (full NS0) ==" build_dir=build-full-ns0-$PYTHON
mkdir -p build && cd build
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 # Valgrind cannot handle the full NS0 because the generated file is too big. Thus run NS0 full without valgrind
cmake \ cmake \

47
.github/main.workflow vendored
View File

@ -1,27 +1,44 @@
workflow "Build and Deploy" { workflow "Build and Deploy" {
on = "push" on = "push"
resolves = ["Build"] resolves = ["Build"]
} }
action "Init Submodules" { action "Init: Submodules" {
needs = "Init Submodules" uses = "./.github/actions/build-base"
uses = "./.github/actions/build-base" runs = "sh -c"
runs = ["git submodule sync && git submodule update --init --recursive"] args = ["git submodule sync && git submodule update --init --recursive"]
} }
action "Build Full NS0" { action "Build: Full NS0 (Python2)" {
needs = "Init Submodules" needs = "Init: Submodules"
uses = "./.github/actions/build-base" uses = "./.github/actions/build-base"
runs = ["./.github/actions/build_full_ns0.sh"] runs = "sh -c"
args = ["export PYTHON=python2 && ./.github/actions/build_full_ns0.sh"]
} }
action "Unit Test Full NS0" { action "Build: Full NS0" {
needs = "Build Full NS0" needs = "Init: Submodules"
uses = "./.github/actions/build-base" uses = "./.github/actions/build-base"
runs = ["cd build && make test"] 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" { action "Build" {
needs = ["Unit Test Full NS0"] uses = "./.github/actions/build-base"
needs = ["Test: Full NS0"]
} }