-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: restructure CI scripts - delete travis uses
Signed-off-by: Adrian Stanea <[email protected]>
- Loading branch information
1 parent
baf3be3
commit cff908e
Showing
7 changed files
with
239 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
TOP_DIR=$(pwd) | ||
|
||
echo_red() { printf "\033[1;31m$*\033[m\n"; } | ||
echo_green() { printf "\033[1;32m$*\033[m\n"; } | ||
|
||
############################################################################ | ||
# Check if the documentation will be generated w/o warnings or errors | ||
############################################################################ | ||
pushd ${TOP_DIR}/build | ||
(cd doc && ! make doc 2>&1 | grep -E "warning|error") || { | ||
echo_red "Documentation incomplete or errors in the generation of it have occured!" | ||
exit 1 | ||
} | ||
|
||
echo_green "Documentation was generated successfully!" | ||
|
||
############################################################################ | ||
# If the current build is not a pull request and it is on master the | ||
# documentation will be pushed to the gh-pages branch | ||
############################################################################ | ||
if [[ "${IS_PULL_REQUEST}" == "False" && "${BRANCH_NAME}" == "master" ]] | ||
then | ||
echo_green "Running Github docs update on commit '$CURRENT_COMMIT'" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CSE-CI" | ||
|
||
pushd ${TOP_DIR} | ||
git fetch --depth 1 origin +refs/heads/gh-pages:gh-pages | ||
git checkout gh-pages | ||
mkdir -p ${TOP_DIR}/python | ||
|
||
cp -R ${TOP_DIR}/build/doc/doxygen_doc/html/* ${TOP_DIR} | ||
cp -R ${TOP_DIR}/build/doc/doxygen_doc/python/* ${TOP_DIR}/python | ||
|
||
sudo rm -rf ${TOP_DIR}/doc | ||
sudo rm -rf ${TOP_DIR}/glog | ||
sudo rm -rf ${TOP_DIR}/build | ||
|
||
# Need to create a .nojekyll file to allow filenames starting with an underscore | ||
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. | ||
if [ ! -f ".nojekyll" ] ; then | ||
touch .nojekyll | ||
fi | ||
|
||
GH_CURRENT_COMMIT=$(git log -1 --pretty=%B) | ||
if [[ ${GH_CURRENT_COMMIT:(-7)} != ${CURRENT_COMMIT:0:7} ]] | ||
then | ||
git add --all . | ||
git commit --allow-empty --amend -m "Update documentation to ${CURRENT_COMMIT:0:7}" | ||
if [ -n "$GITHUB_DOC_TOKEN" ] ; then | ||
git push https://${GITHUB_DOC_TOKEN}@github.com/${REPO_SLUG} gh-pages -f | ||
else | ||
git push origin gh-pages -f | ||
fi | ||
echo_green "Documentation updated!" | ||
else | ||
echo_green "Documentation already up to date!" | ||
fi | ||
else | ||
echo_green "Documentation will be updated when this commit gets on master!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh -e | ||
|
||
TOP_DIR=$(pwd) | ||
LIBIIO_VERSION=libiio-v0 | ||
|
||
set -x | ||
|
||
# Note: not installing 'mono', it comes with Azure images, | ||
# but it doesn't look it's installed with Homebrew | ||
brew install cmake doxygen libusb libxml2 swig curl python | ||
# libiio deps | ||
brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config | ||
pip3 install sphinx | ||
|
||
pip3 install wheel twine build virtualenv | ||
|
||
# Install glog | ||
echo "Building glog" | ||
cd ${TOP_DIR} | ||
git clone --branch v0.4.0 --depth 1 https://github.com/google/glog | ||
mkdir -p glog/build_0_4_0 && cd glog/build_0_4_0 | ||
cmake .. | ||
make | ||
sudo make install | ||
|
||
# Install libiio | ||
echo "Building libiio - version $LIBIIO_VERSION" | ||
cd ${TOP_DIR} | ||
git clone https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION libiio | ||
mkdir ./libiio/build && cd ./libiio/build | ||
cmake ../ | ||
make | ||
sudo make install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh -e | ||
|
||
TOP_DIR=$(pwd) | ||
|
||
set -x | ||
|
||
mkdir -p build | ||
mkdir -p build_tar | ||
export MACOSX_DEPLOYMENT_TARGET=10.15 | ||
|
||
cd build | ||
cmake -DOSX_PACKAGE=ON -DENABLE_TOOLS=ON -DENABLE_PYTHON=ON -DENABLE_CSHARP=ON -DENABLE_LOG=ON -DBUILD_EXAMPLES=ON .. | ||
make | ||
ls | ||
|
||
cd ${TOP_DIR}/build_tar | ||
cmake -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DENABLE_PYTHON=ON -DENABLE_CSHARP=ON -DENABLE_TOOLS=ON -DENABLE_LOG=ON -DBUILD_EXAMPLES=ON .. | ||
make && make package | ||
ls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh -e | ||
|
||
TOP_DIR=$(pwd) | ||
LIBIIO_VERSION=libiio-v0 | ||
|
||
set -x | ||
|
||
handle_default() { | ||
sudo apt-get -qq update | ||
echo "libm2k packages" | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake doxygen graphviz \ | ||
libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev \ | ||
libxml2-dev rpm tar bzip2 gzip flex bison git curl \ | ||
python3-dev python3-setuptools python3-pip python3-all \ | ||
debhelper devscripts fakeroot libserialport-dev swig dh-python | ||
|
||
# libiio dependencies | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
libxml2-dev bison flex libcdk5-dev cmake \ | ||
libaio-dev libusb-1.0-0-dev \ | ||
libserialport-dev libavahi-client-dev | ||
|
||
#Install glog | ||
cd ${TOP_DIR} | ||
git clone --branch v0.4.0 --depth 1 https://github.com/google/glog | ||
mkdir -p glog/build_0_4_0 && cd glog/build_0_4_0 | ||
cmake -DCMAKE_PREFIX_PATH=/usr .. | ||
make | ||
sudo make install | ||
sudo pip3 install --upgrade pip stdeb argparse | ||
|
||
# Install libiio | ||
echo "Building libiio - version $LIBIIO_VERSION" | ||
cd ${TOP_DIR} | ||
git clone https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION libiio | ||
mkdir ./libiio/build && cd ./libiio/build | ||
cmake ../ | ||
make | ||
sudo make install | ||
} | ||
|
||
handle_doxygen() { | ||
# TODO: REVIE THIS AFTER THE REWORK - IT MIGHT BREAK | ||
# Install a recent version of doxygen | ||
DOXYGEN_URL="wget https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.src.tar.gz" | ||
cd ${DEPS_DIR} | ||
[ -d "doxygen" ] || { | ||
mkdir doxygen && wget --quiet -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C doxygen | ||
} | ||
cd doxygen | ||
mkdir -p build && cd build | ||
cmake .. | ||
make -j${NUM_JOBS} | ||
sudo make install | ||
cd .. | ||
cd .. | ||
|
||
cd ${TOP_DIR}/doc | ||
mkdir -p build && cd build | ||
cmake .. | ||
cd .. | ||
cd .. | ||
|
||
handle_default | ||
cd ${TOP_DIR} | ||
#Also install Sphinx for Python bindings | ||
sudo apt-get install python3-sphinx | ||
sudo pip3 install --upgrade sphinx_rtd_theme | ||
} | ||
|
||
handle_ubuntu_docker() { | ||
handle_default | ||
} | ||
|
||
handle_${OS_TYPE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh -e | ||
|
||
TOP_DIR=$(pwd) | ||
|
||
set -x | ||
|
||
handle_default() { | ||
mkdir -p build | ||
cd build | ||
|
||
#create deb for bindings | ||
cmake -DENABLE_PYTHON=ON -DENABLE_TOOLS=ON -DENABLE_CSHARP=OFF -DENABLE_LOG=ON -DBUILD_EXAMPLES=ON .. && make | ||
sudo python3 setup.py --command-packages=stdeb.command sdist_dsc | ||
cd "$(find . -type d -name "debian" | head -n 1)" | ||
sudo env DEB_BUILD_OPTIONS=nocheck debuild -us -uc | ||
cp ../../*.deb ${TOP_DIR}/build/ | ||
cd ${TOP_DIR}/build/ | ||
#remove the tar.gz for bindings | ||
sudo rm *.tar.gz | ||
ls | ||
|
||
#create simple .deb without Python bindings | ||
cmake -DENABLE_PACKAGING=ON -DDEB_DETECT_DEPENDENCIES=ON -DENABLE_PYTHON=OFF -DENABLE_CSHARP=ON -DENABLE_TOOLS=ON -DENABLE_LOG=ON -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_EXAMPLES=ON .. | ||
make && make package | ||
ls | ||
} | ||
|
||
handle_doxygen() { | ||
mkdir -p build | ||
cd build | ||
cmake -DENABLE_PYTHON=ON -DENABLE_CSHARP=OFF -DENABLE_DOC=ON .. | ||
make && sudo make install | ||
make doc | ||
cd .. | ||
./CI/doxygen.sh | ||
} | ||
|
||
handle_ubuntu_docker() { | ||
handle_default | ||
} | ||
|
||
handle_${OS_TYPE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters