Skip to content
Snippets Groups Projects
.gitlab-ci.yml 5.12 KiB
Newer Older
Martin Bauer's avatar
Martin Bauer committed
stages:
  - test
  - deploy


# --------------------------  Tests ------------------------------------------------------------------------------------

# Normal test - runs on every commit all but "long run" tests
tests-and-coverage:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
  script:
Martin Bauer's avatar
Martin Bauer committed
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
    - mkdir public
Martin Bauer's avatar
Martin Bauer committed
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
    - env
    - pip list
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. -m "not longrun" --junitxml=report.xml
    - python3 -m coverage xml
Martin Bauer's avatar
Martin Bauer committed
  tags:
    - docker
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
    - AVX
  artifacts:
    when: always
    paths:
      - coverage_report
    reports:
      cobertura: coverage.xml
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed

# Nightly test  - runs "long run" jobs only
test-longrun:
  stage: test
  only:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
  script:
Martin Bauer's avatar
Martin Bauer committed
    - export NUM_CORES=$(nproc --all)
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
    - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
  tags:
    - docker
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
    - AVX
  artifacts:
    when: always
Martin Bauer's avatar
Martin Bauer committed
    paths:
      - coverage_report
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed

# Minimal tests in windows environment
minimal-windows:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  tags:
    - win
  script:
    - source /cygdrive/c/Users/build/Miniconda3/Scripts/activate
    - source activate pystencils_dev
    - env
    - conda env list
Martin Bauer's avatar
Martin Bauer committed
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
Martin Bauer's avatar
Martin Bauer committed
    - python -c "import numpy"
    - python setup.py quicktest

Martin Bauer's avatar
Martin Bauer committed
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/ubuntu
Martin Bauer's avatar
Martin Bauer committed
  script:
    - mkdir -p ~/.config/matplotlib
    - echo "backend:template" > ~/.config/matplotlib/matplotlibrc
Martin Bauer's avatar
Martin Bauer committed
    - pip3 install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
    - env
    - pip3 list
    - pytest-3 -v -m "not longrun" --junitxml=report.xml
Martin Bauer's avatar
Martin Bauer committed
  tags:
    - docker
    - cuda11
  artifacts:
    when: always
    reports:
      junit: report.xml
Martin Bauer's avatar
Martin Bauer committed

minimal-conda:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/minimal_conda
Martin Bauer's avatar
Martin Bauer committed
  script:
Martin Bauer's avatar
Martin Bauer committed
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
Martin Bauer's avatar
Martin Bauer committed
    - python setup.py quicktest
  tags:
    - docker

pycodegen-integration:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
  stage: test
  when: manual
Markus Holzer's avatar
Markus Holzer committed
  allow_failure: true
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pycodegen.git
    - cd pycodegen
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git submodule foreach git fetch origin   # compare the latest master version!
    - git submodule foreach git reset --hard origin/master
    - cd lbmpy
    - git remote add test $CI_REPOSITORY_URL
    - git fetch test
    - git reset --hard $CI_COMMIT_SHA
    - cd ..
    - pip install -e pystencils/
    - pip install -e lbmpy/
    - ./install_walberla.sh
Frederik Hennig's avatar
Frederik Hennig committed
    # build all integration tests
    - cd walberla/build/
    - make -j $NUM_CORES MicroBenchmarkGpuLbm LbCodeGenerationExample
    - cd apps/benchmarks/UniformGridGPU
    - make -j $NUM_CORES
    - cd ../UniformGridGenerated
    - make -j $NUM_CORES
    - cuda11
Martin Bauer's avatar
Martin Bauer committed

# -------------------- Linter & Documentation --------------------------------------------------------------------------


flake8-lint:
  stage: test
  except:
    variables:
      - $ENABLE_NIGHTLY_BUILDS
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
  script:
    - flake8 lbmpy
  tags:
    - docker
    - cuda11
Martin Bauer's avatar
Martin Bauer committed


build-documentation:
  stage: test
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
  script:
    - export PYTHONPATH=`pwd`
Martin Bauer's avatar
Martin Bauer committed
    - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
Martin Bauer's avatar
Martin Bauer committed
    - mkdir html_doc
Markus Holzer's avatar
Markus Holzer committed
    - sphinx-build -b html doc html_doc
    - sphinx-build -W -b html doc html_doc
Martin Bauer's avatar
Martin Bauer committed
  tags:
    - docker
    - cuda11
Martin Bauer's avatar
Martin Bauer committed
  artifacts:
    paths:
      - html_doc


pages:
  image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full
Martin Bauer's avatar
Martin Bauer committed
  stage: deploy
  script:
    - ls -l
    - mv coverage_report html_doc
    - mv html_doc public  # folder has to be named "public" for gitlab to publish it
  artifacts:
    paths:
      - public
  tags:
    - docker
  only:
    - master@pycodegen/lbmpy