.gitlab-ci.yml 1.66 KB
Newer Older
Jakob Antonius Baatz's avatar
add ci  
Jakob Antonius Baatz committed
1
image: continuumio/miniconda3:latest
Adrian Wuillemet's avatar
Adrian Wuillemet committed
2

Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
3 4 5 6 7
stages:
  - build
  - test
  - deploy

Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
8
before_script:
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
9
  - conda update conda -y
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
10 11
  - conda env create -f environment.yaml
  - source activate myenv
12
  - cd source/
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
13

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
build:
  stage: build
  script:
    - pip install click
    - pip install eel
    - pip install markdown
    - cp README.md beads/resources/info/README.md
    - npm config set strict-ssl false
    - npm install -g typescript
    - npm install -g sass
    - npm install @types/d3 --prefix ts/
    - sass --no-source-map sass/gui.scss beads/resources/ui/css/gui.css
    - tsc -b ts/
  artifacts:
      paths:
        - source/beads/
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
30

Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
31 32 33 34 35 36 37 38
deploy_staging:
  stage: deploy
  variables:
      TWINE_USERNAME: $STAGING_USERNAME
      TWINE_PASSWORD: $STAGING_PASSWORD
  script:
    - pip install --user --upgrade setuptools wheel
    - pip install -U twine
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
39
    - python setup.py sdist bdist_wheel
Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
40
    - twine check dist/*
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
41
    - twine upload --verbose --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
42 43 44 45 46 47 48 49 50 51 52
  only:
    - stage

deploy_production:
  stage: deploy
  variables:
      TWINE_USERNAME: $PRODUCTION_USERNAME
      TWINE_PASSWORD: $PRODUCTION_PASSWORD
  script:
    - pip install --user --upgrade setuptools wheel
    - pip install -U twine
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
53
    - python setup.py sdist bdist_wheel
Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
54 55 56 57 58
    - twine check dist/*
    - twine upload --skip-existing dist/*
  only:
    - release

Jakob Antonius Baatz's avatar
add ci  
Jakob Antonius Baatz committed
59
unittests:
Jakob Antonius Baatz's avatar
add cd  
Jakob Antonius Baatz committed
60
  stage: test
Adrian Wuillemet's avatar
Adrian Wuillemet committed
61
  script:
Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
62 63
    - nosetests tests/ -v --nocapture

Jakob Antonius Baatz's avatar
Jakob Antonius Baatz committed
64

65 66 67 68 69 70 71
testbuild:
  stage: test
  script:
    - test -f "beads/resources/ui/css/gui.css"
    - test -f "beads/resources/ui/js/gui.js"
    - test -f "beads/resources/options/default_options.json"
    - test -f "beads/resources/info/README.md"