.gitlab-ci.yml 3.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
stages:
  - init
  - test
  - pages

### Static Badges ###
version:
  stage: init
  tags:
    - leap
    - zam347
    - base
  only:
    - master
    - tags
  script:
    - chmod +x ./CI/update_badge.sh
    - chmod +x ./CI/create_version_badge.sh
    - ./CI/create_version_badge.sh
  artifacts:
    name: pages
    when: always
    paths:
      - badges/

26 27
### Tests (from scratch) ###
tests (from scratch):
lukas leufen's avatar
lukas leufen committed
28
  tags:
29
    - base
lukas leufen's avatar
lukas leufen committed
30
    - zam347
31 32 33 34 35 36 37
  stage: test
  only:
    - master
    - /^release.*$/
    - develop
  variables:
    FAILURE_THRESHOLD: 100
38
    TEST_TYPE: "scratch"
39 40 41
  before_script:
    - chmod +x ./CI/update_badge.sh
    - ./CI/update_badge.sh > /dev/null
lukas leufen's avatar
lukas leufen committed
42
  script:
43 44 45 46 47 48 49 50 51 52 53 54 55
    - zypper --non-interactive install binutils libproj-devel gdal-devel
    - zypper --non-interactive install proj geos-devel
    - pip install -r requirements.txt
    - chmod +x ./CI/run_pytest.sh
    - ./CI/run_pytest.sh
  after_script:
    - ./CI/update_badge.sh > /dev/null
  artifacts:
    name: pages
    when: always
    paths:
      - badges/
      - test_results/
lukas leufen's avatar
lukas leufen committed
56

57 58
### Tests (on GPU) ###
tests (on GPU):
lukas leufen's avatar
lukas leufen committed
59 60 61
  tags:
    - gpu
    - zam347
62 63 64 65 66 67 68
  stage: test
  only:
    - master
    - /^release.*$/
    - develop
  variables:
    FAILURE_THRESHOLD: 100
69
    TEST_TYPE: "gpu"
70 71 72
  before_script:
    - chmod +x ./CI/update_badge.sh
    - ./CI/update_badge.sh > /dev/null
lukas leufen's avatar
lukas leufen committed
73
  script:
74 75 76 77 78 79 80 81 82 83 84
    - pip install -r requirements.txt
    - chmod +x ./CI/run_pytest.sh
    - ./CI/run_pytest.sh
  after_script:
    - ./CI/update_badge.sh > /dev/null
  artifacts:
    name: pages
    when: always
    paths:
      - badges/
      - test_results/
lukas leufen's avatar
lukas leufen committed
85

86
### Tests ###
87 88
tests:
  tags:
89
    - machinelearningtools
90 91 92
    - zam347
  stage: test
  variables:
93
    FAILURE_THRESHOLD: 100
94 95 96 97 98 99 100 101 102 103 104 105 106 107
  before_script:
    - chmod +x ./CI/update_badge.sh
    - ./CI/update_badge.sh > /dev/null
  script:
    - pip install -r requirements.txt
    - chmod +x ./CI/run_pytest.sh
    - ./CI/run_pytest.sh
  after_script:
    - ./CI/update_badge.sh > /dev/null
  artifacts:
    name: pages
    when: always
    paths:
      - badges/
108
      - test_results/
109 110 111

coverage:
  tags:
112
    - machinelearningtools
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
    - zam347
  stage: test
  variables:
    FAILURE_THRESHOLD: 50
    COVERAGE_PASS_THRESHOLD: 80
  before_script:
    - chmod +x ./CI/update_badge.sh
    - ./CI/update_badge.sh > /dev/null
  script:
    - pip install -r requirements.txt
    - chmod +x ./CI/run_pytest_coverage.sh
    - ./CI/run_pytest_coverage.sh
  after_script:
    - ./CI/update_badge.sh > /dev/null
  artifacts:
    name: pages
    when: always
    paths:
      - badges/
      - coverage/

#### Pages ####
pages:
  stage: pages
  tags:
    - zam347
    - base
  script:
    - mkdir -p public/badges/
    - cp -af  badges/badge_*.svg public/badges/
    - ls public/badges/
    - mkdir -p public/coverage
    - cp -af coverage/. public/coverage
    - ls public/coverage
147
    - mkdir -p public/test
148
    - cp -af test_results/. public/test
149
    - ls public/test
150 151 152 153 154 155 156 157 158
    - ls public
  when: always
  artifacts:
    name: pages
    when: always
    paths:
      - public
      - badges/
      - coverage/
159
      - test_results/
160 161 162 163 164
  cache:
    key: old-pages
    paths:
      - public/badges/
      - public/coverage/
165
      - public/test/