Commit bea10fd2 authored by William Clarke's avatar William Clarke
Browse files

First attempt at build CI.

parent 4b50dab5
###########################################################################
# This file defines the build process for fsl-mrs, as hosted at:
#
# https://git.fmrib.ox.ac.uk/fsl/fsl_mrs
#
# The build pipeline currently comprises the following stages:
#
# 1. style: Check coding style - allowed to fail
#
# 2. test: Unit tests
#
# 3. doc: Building user documentation which appears at:
# https://open.win.ox.ac.uk/pages/fsl/fsl_mrs/
#
# 4. build: Building source and wheel distributions for
# releases
#
# A custom docker image is used for the test job - images are
# available at:
#
# https://hub.docker.com/u/wtclarke/
#
# Stage run conditions:
# Style is run in all cases, but allowed to fail.
# Test is run in all cases.
# Doc is only run on master branches.
# Build is run only with releases on upstream repo.
#
###########################################################################
stages:
- Static Analysis
- Test
- doc
flake8:
image: python:3.7-slim-buster
stage: Static Analysis
before_script:
- python --version
- pip install flake8
script:
- flake8 --max-line-length=120 fsl_mrs
allow_failure: true
# - style
# - test
# - doc
- build
####################################
# These anchors are used to restrict
# when and where jobs are executed.
####################################
.only_upstream: &only_upstream
only:
- branches@fsl/fsl_mrs
.only_master: &only_master
only:
- master
.only_releases: &only_releases
only:
- tags@fsl/fsl_mrs
.except_releases: &except_releases
except:
- tags
pytest:
image: wtclarke/fsl_mrs_tests:1.0
stage: Test
# ############
# # 1. style
# ############
# flake8:
# image: python:3.7-slim-buster
# stage: style
# before_script:
# - python --version
# - pip install flake8
# script:
# - flake8 fsl_mrs
# allow_failure: true
# ############
# # 2. test
# ############
# pytest:
# image: wtclarke/fsl_mrs_tests:1.0
# stage: test
# variables:
# GIT_SUBMODULE_STRATEGY: normal
# before_script:
# - conda init bash
# - source ~/.bashrc
# - conda create -n fsl_mrs -y python=3.7
# - conda activate fsl_mrs
# - conda install -y -c conda-forge -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel/ --file requirements.txt
# - conda install -y -c conda-forge pytest
# - pip install .
# script:
# - pytest fsl_mrs/tests
# ############
# # 3. doc
# ############
# pages:
# <<: *only_master
# image: python:3.7
# stage: doc
# script:
# - pip install -U sphinx sphinx_rtd_theme
# - sphinx-build -b html ./docs/user_docs public
# artifacts:
# paths:
# - public
############
# 3. build
############
build-conda-dist:
#<<: *only_releases
image: wtclarke/fsl_mrs_build:1.0
stage: build
variables:
GIT_SUBMODULE_STRATEGY: normal
before_script:
- conda init bash
- source ~/.bashrc
- conda create -n fsl_mrs -y python=3.7
- conda activate fsl_mrs
- conda install -y -c conda-forge -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel/ --file requirements.txt
- conda install -y -c conda-forge pytest
- pip install .
script:
- pytest fsl_mrs/tests
pages:
image: python:3.7
stage: doc
script:
- pip install -U sphinx sphinx_rtd_theme
- sphinx-build -b html ./docs/user_docs public
- conda activate fsl_build
- conda build --output-folder ./dist/ -c defaults -c conda-forge -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/channel/ ./.conda
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- ./dist
\ No newline at end of file
Supports Markdown
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