Commit c51da37c authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

add CI

parent cc3718e8
Pipeline #1840 failed with stage
in 7 minutes and 27 seconds
#
# Copyright Jean-Charles Lambert, 2018-2019
#
# - YAML file for Continous Integration / Continous Deployement
# - uns_projects and python-unsiotools packages (RPM or DEB) are automatically
# generated at new commit for different linux distribution
# - add manylinux building for python-module
#
# - Documentation :
# https://docs.gitlab.com/ee/ci/yaml/
stages:
- build
- testpypi
- pypi
variables :
TWINE_USERNAME: jcl
TWINE_PASSWORD: $TEST_PY_PASSWD
WHEEL : 0
TESTPYPI : 0
PYPI : 0
OSX : 0
TESTPYPIOSX : 0
PYPIOSX : 0
before_script:
# clone
#- git clone https://gitlab.lam.fr/jclamber/unsio.git
#- cd unsio
#- git branch -r
#- git checkout origin/new_cmake
#
# BUILD wheels for all linux flavors/python
#
manylinux2010 :
stage : build
image : portus.lam.fr/jclamber/unsio-manylinux2010
only :
variables:
- $WHEEL == "1"
script:
# build
- CI/script/build.sh cmake3
- CI/script/build-wheel.sh
- CI/script/repair-wheel.sh
- /opt/python/cp37-cp37m/bin/python setup.py sdist -d wheel
cache:
key: manylinux2010
paths:
- wheel/
artifacts:
name: "manylinux2010"
paths:
- test-*.res
- wheel/*
expire_in: 1 week
# Push wheel to testpypi repos
push-testpypi-manylinux2010:
stage: testpypi
image : portus.lam.fr/jclamber/unsio-manylinux2010
only :
variables:
- $TESTPYPI == "1"
script:
- /opt/python/cp37-cp37m/bin/python -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD --repository-url https://test.pypi.org/legacy/ ./wheel/python*uns*manylinux2010* ./wheel/python*uns*gz
cache:
key: manylinux2010
paths:
- wheel/
# Push wheel to pypi repos
push-pypi-manylinux2010:
stage: pypi
image : portus.lam.fr/jclamber/unsio-manylinux2010
only :
variables:
- $PYPI == "1"
script:
- /opt/python/cp37-cp37m/bin/python -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD ./wheel/python*uns*manylinux2010* ./wheel/python*uns*gz
cache:
key: manylinux2010
paths:
- wheel/
#
# MANYLINUX1
#
manylinux1 :
stage : build
image : portus.lam.fr/jclamber/unsio-manylinux1
only :
variables:
- $WHEEL == "1"
script:
# build
- CI/script/build.sh cmake
- CI/script/build-wheel.sh
- CI/script/repair-wheel.sh
cache:
key: manylinux1
paths:
- wheel/
artifacts:
name: "manylinux1"
paths:
- test-*.res
- wheel/*
expire_in: 1 week
# Push wheel to testpypi repos
push-testpypi-manylinux1:
stage: testpypi
image : portus.lam.fr/jclamber/unsio-manylinux1
only :
variables:
- $TESTPYPI == "1"
script:
- /opt/python/cp37-cp37m/bin/python -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD --repository-url https://test.pypi.org/legacy/ ./wheel/python*uns*manylinux1*
cache:
key: manylinux1
paths:
- wheel/
# Push wheel to pypi repos
push-pypi-manylinux1:
stage: pypi
image : portus.lam.fr/jclamber/unsio-manylinux1
only :
variables:
- $PYPI == "1"
script:
- /opt/python/cp37-cp37m/bin/python -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD ./wheel/python*uns*manylinux1*
cache:
key: manylinux1
paths:
- wheel/
#
# BUILD wheels for macosx
#
OSX:
stage : build
tags:
- osx_10.13.6
only :
variables:
- $OSX == "1"
script:
# build
- CI/scriptOSX/build-unsio.sh
- CI/scriptOSX/build-wheel.sh
- CI/scriptOSX/repair-wheel.sh
- CI/scriptOSX/test-unsio.sh
cache:
key: osx
paths:
- wheel/
artifacts:
name: "osx-wheel"
paths:
- test-*.res
- wheel/*
expire_in: 1 week
# Push wheel to testpypi repos
push-testpypi-OSX:
stage: testpypi
tags:
- osx_10.13.6
only :
variables:
- $TESTPYPIOSX == "1"
script:
- python3.7 -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD --repository-url https://test.pypi.org/legacy/ ./wheel/python*uns*macosx*
cache:
key: osx
paths:
- wheel/
# Push wheel to pypi repos
push-pypi-OSX:
stage: pypi
tags:
- osx_10.13.6
only :
variables:
- $PYPIOSX == "1"
script:
- python3.7 -m twine upload --disable-progress-bar -u $TWINE_USERNAME -p $TWINE_PASSWORD ./wheel/python*uns*macosx*
cache:
key: osx
paths:
- wheel/
#
# RPM Distros
#
opensuse42.3 :
stage : build
image: ppfb.lam.fr:5000/jcl-dev/opensuse42.3
only :
- tags
script:
# build
- ../CI/build-rpm.sh 0opensuse42.3
artifacts:
name: "opensuse42.3"
paths:
- unsio/build/*.rpm
- unsio/dist/*.rpm
- unsio/dist/*.gz
fedora28 :
stage : build
image: ppfb.lam.fr:5000/jcl-dev/fedora28
only :
- tags
script:
# build
- ../CI/build-rpm.sh 0fc28
artifacts:
name: "fedora28"
paths:
- unsio/build/*.rpm
- unsio/dist/*.rpm
- unsio/dist/*.gz
fedora27 :
stage : build
image: ppfb.lam.fr:5000/jcl-dev/fedora27
only :
- tags
script:
# build
- ../CI/build-rpm.sh 0fc27
artifacts:
name: "fedora27"
paths:
- unsio/build/*.rpm
- unsio/dist/*.rpm
- unsio/dist/*.gz
mageia6 :
stage : build
image: ppfb.lam.fr:5000/jcl-dev/mageia6
only :
- tags
script:
# build
- ../CI/build-rpm.sh 0mga6
artifacts:
name: "mageia6"
paths:
- unsio/build/*.rpm
- unsio/dist/*.rpm
- unsio/dist/*.gz
#
# DEB distos
#
ubuntu 18.04:
stage : build
image: ppfb.lam.fr:5000/jcl-dev/ubuntu18.04
only :
- tags
script:
# build
- ../CI/build-deb.sh 0ubuntu18.04
artifacts:
name: "ubuntu18.04"
paths:
- unsio/build/*.deb
- unsio/my_deb/*.deb
- unsio/my_deb/*.gz
ubuntu 16.04:
stage : build
image: ppfb.lam.fr:5000/jcl-dev/ubuntu16.04
only :
- tags
script:
# build
- ../CI/build-deb.sh 0ubuntu16.04
artifacts:
name: "ubuntu16.04"
paths:
- unsio/build/*.deb
- unsio/my_deb/*.deb
- unsio/my_deb/*.gz
#!/bin/bash
# build wheel
#PATH=/opt/usr/bin/:/opt/python/cp27-cp27m/bin:${PATH} pip wheel ./unsio/ -w wheelhouse
rm -f wheel/*uns*manylinux*.whl wheel/*uns*tar.gz wheelhouse/*uns*manylinux*.whl
# build wheel
for PYBIN in /opt/python/*/bin/; do
echo "Compiling using pip version ${PYBIN}...."
PATH=/opt/usr/bin/:${PYBIN}:${PATH} pip wheel --no-deps ./ -w wheelhouse
done
#!/bin/bash
#
# Give as paramameter cmake (manylinux1) or cmake3 (manylinux2010)
#
mycmake=$1
# clone & build unsio
git clone https://gitlab.lam.fr/jclamber/unsio.git
cd unsio
$mycmake . -DCMAKE_INSTALL_PREFIX=/usr/local
make -j 4 && make install
# Activate nemo environment
source /opt/usr/nemo/nemo_start.sh
# build uns_projects
cd ..
$mycmake . -DCMAKE_INSTALL_PREFIX=/usr
make -j 4
make install
#!/bin/bash
# Bundle external shared libraries into the wheels
for whl in wheelhouse/*unsio*.whl; do
echo "repairing $whl...."
auditwheel repair "$whl" -w ./wheel
done
#!/bin/bash
# Configure building environment
# We must deactivate RPATH (-DNO_RPATH=1) to allow to unsiolib to
# be included into the wheels
cmake . -DNO_RPATH=1
make -j 2
make install
#!/bin/bash
rm -f wheel/*unsio*osx*.whl wheelhouse/*unsio*osx*.whl
# Activate python environement
# Build wheel
for PYENV in ${HOME}/venv/unsio*; do
echo "Activate ${PYENV}...."
source ${PYENV}/bin/activate
pip wheel --no-deps ./ -w wheelhouse
deactivate
done
#!/bin/bash
# Activate python37 to have delocate-wheel
# delocate-wheel works the same with all python versions
source ${HOME}/venv/unsio37/bin/activate
# Bundle external shared libraries into the wheels
for whl in wheelhouse/*unsio*.whl; do
echo "repairing $whl...."
delocate-wheel "$whl" -w ./wheel
done
# de-activate python37
deactivate
#!/bin/bash
# Install unsio wheel for every python
# Run test program
for PYVER in 34 35 36 37; do
PYENV=${HOME}/venv/unsio${PYVER}
echo "Activate ${PYENV}...."
source ${PYENV}/bin/activate
pip install wheel/*unsio*${PYVER}*-macosx*.whl
python -m unsio.test.ctestunsio --out test-${PYVER}.res
deactivate
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment