Commit 58b0f864 authored by Thomas Vincent's avatar Thomas Vincent

Test .gitlab-ci.yml based on common 'bob' project

parent 08bea8b5
Pipeline #12233 passed with stages
in 4 minutes and 53 seconds
include:
- remote: 'https://gitlab.esrf.fr/silx/bob/main/raw/master/job-templates.yml'
stages:
- build_source
- build
- test
- deploy
variables: # Global variables
VENV_DIR: xsocs_venv
http_proxy: http://proxy.esrf.fr:3128
https_proxy: http://proxy.esrf.fr:3128
no_proxy: .esrf.fr,localhost
### Linux ###
# Target definitions
.linux_build_template: &linux_build_definition
stage: build
tags:
- linux
image: ${IMAGE}
before_script:
- rm -rf ${VENV_DIR}
- pip install --upgrade virtualenv # Make sure virtualenv is installed
- virtualenv --python=${PYTHON} ${VENV_DIR}
- source ${VENV_DIR}/bin/activate
- pip install --upgrade pip setuptools
- pip install --upgrade --pre -r requirements-dev.txt
- which python
- python ./ci/info_platform.py
script:
- python setup.py bdist_wheel
- ls dist/
after_script:
- rm -rf ${VENV_DIR}
artifacts:
paths:
- dist/
when: on_success
expire_in: 2h
.linux_test_template: &linux_test_definition
stage: test
tags:
- linux
image: ${IMAGE}
before_script:
- rm -rf ${VENV_DIR}
- pip install --upgrade virtualenv # Make sure virtualenv is installed
- virtualenv --python=${PYTHON} ${VENV_DIR}
- source ${VENV_DIR}/bin/activate
- pip install --upgrade pip setuptools
# TODO use requirements file - pip install -r requirements.txt
# Install numpy first as it is needed to build xrayutilities
- pip install --pre numpy --only-binary numpy
- pip install --pre h5py fabio scipy silx xrayutilities --only-binary scipy,h5py,silx,fabio
- which python
- python ./ci/info_platform.py
script:
- pip install --pre --find-links dist/ --no-cache-dir --no-index xsocs
- python run_tests.py --installed -v
after_script:
- rm -rf ${VENV_DIR}
#- deploy
# Python2 tasks
.linux_python2_variables:
variables: &linux_python2_definition
IMAGE: python:2.7-jessie
PYTHON: python2
variables:
PROJECT: xsocs
linux_build_python2:
<<: *linux_build_definition
variables: *linux_python2_definition
linux_test_python2:
<<: *linux_test_definition
dependencies:
- linux_build_python2
variables: *linux_python2_definition
source:
extends: .local_source_build
# Python3 tasks
.linux_python3_variables:
variables: &linux_python3_definition
IMAGE: python:3.5-stretch
PYTHON: python3
manylinux1_wheels:
extends: .manylinux1_wheels
linux_build_python3:
<<: *linux_build_definition
variables: *linux_python3_definition
linux_test_python3:
<<: *linux_test_definition
dependencies:
- linux_build_python3
variables: *linux_python3_definition
# Test
.test_template: &test_template_defintion
stage: test
script:
# numpy is needed to build xrayutilities
- pip install --pre numpy --only-binary numpy
- pip install --pre --find-links artifacts/ --only-binary xsocs xsocs
- python run_tests.py --installed -v
### Documentation ###
# Deploy documentation in gitlab (only for master branch)
pages:
stage: deploy
manylinux1_test_cp27:
<<: *test_template_defintion
image: python:2.7
tags:
- linux
image: python:2.7-jessie
before_script:
- ls -l artifacts
dependencies:
- windows_build_python3
script:
- rm -rf public
- mv build/sphinx/html public
artifacts:
paths:
- public
only:
- master
- manylinux1_wheels
### Windows ###
.windows_template: &windows_definition
manylinux1_test_cp37:
<<: *test_template_defintion
image: python:3.7
tags:
- win
- linux
before_script:
- SET "PATH=C:\\miniconda3;C:\\miniconda3\\Scripts;%PATH%"
- python -m venv --clear %VENV_DIR%
- call "%VENV_DIR%\\Scripts\\activate.bat"
- python -m pip install --upgrade pip
- python ci\info_platform.py
script:
after_script:
- rmdir %VENV_DIR% /s /q
windows_build_python3:
<<: *windows_definition
stage: build
script:
- pip install --upgrade --pre -r requirements-dev.txt
- python ci\info_platform.py
# Build the wheel
- python setup.py bdist_wheel
# Build the doc (dependencies are needed)
- pip install --upgrade --pre -r requirements.txt
- python setup.py build build_doc
- dir dist
artifacts:
paths:
- dist
- build/sphinx/html/
when: on_success
expire_in: 2h
windows_test_python3:
<<: *windows_definition
stage: test
- ls -l artifacts
dependencies:
- windows_build_python3
script:
# Install numpy first as it is needed to build xrayutilities
- pip install --pre numpy --only-binary numpy
- pip install --pre h5py fabio scipy silx xrayutilities --only-binary scipy,h5py,silx,fabio
- python ci\info_platform.py
# Install wheel and run the tests
- pip install --pre --find-links dist/ --no-cache-dir --no-index xsocs
- python run_tests.py --installed -v
- manylinux1_wheels
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