Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.38 KiB
Newer Older
Michael Buehlmann's avatar
Michael Buehlmann committed
stages:
  - build
  - docs
  - deploy


image: debian:latest
before_script:
  - apt update && apt -y install git gcc cmake mpich

build_makefile:
  stage: build
  script:
    - make

build_cmake:
  stage: build
  script:
    - mkdir build && cd build
    - cmake ..
    - make

build_python:
  stage: build
  before_script:
Michael Buehlmann's avatar
Michael Buehlmann committed
    - apt update && apt -y install git gcc cmake mpich python3 python3-pip python3-venv
    - python3 -m venv ./venv
    - ./venv/bin/python -m pip install numpy wheel
  script:
Michael Buehlmann's avatar
Michael Buehlmann committed
    - ./venv/bin/python setup.py bdist_wheel
    - ./venv/bin/python -m pip install dist/*
  artifacts:
    paths:
      - dist/*.whl
  variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  cache:
    paths:
      - .cache/pip
      - venv/
Michael Buehlmann's avatar
Michael Buehlmann committed

build_docs:
  stage: docs
  dependencies:
    - build_python
  before_script:
Michael Buehlmann's avatar
Michael Buehlmann committed
    - apt update && apt -y install mpich python3 python3-pip python3-venv
    - python3 -m venv ./venv
    - ./venv/bin/python -m pip install numpy wheel
    - ./venv/bin/python -m pip install dist/*
    - ./venv/bin/python -m pip install Sphinx sphinx-rtd-theme sphinxcontrib-napoleon numpydoc myst-parser
Michael Buehlmann's avatar
Michael Buehlmann committed
  script:
Michael Buehlmann's avatar
Michael Buehlmann committed
    - source ./venv/bin/activate
Michael Buehlmann's avatar
Michael Buehlmann committed
    - cd docs
    - make dirhtml
  artifacts:
    paths:
      - docs/_build/dirhtml/
      
deploy_docs:
  stage: deploy
  dependencies:
    - build_docs
  script:
   - rsync -avp docs/_build/dirhtml/ /tmp/genericio
  tags:
   - docs