.gitlab-ci.yml 2.29 KB
Newer Older
1 2
stages:
  - check
3
  - unit_test
4 5
  - lets_encrypt_staging

6 7 8 9
.install_dependencies: &install_dependencies
    - apt-get update && apt-get install -y --no-install-recommends
      python3-minimal python3-dnspython python3-requests

10 11 12 13 14 15 16
.check:
  stage: check
  image: debian:buster-slim
  only:
    - merge_requests
    - master

17 18 19 20 21 22 23 24 25 26 27 28
.unit_test:
  stage: unit_test
  before_script:
    - *install_dependencies
    - apt-get install -y --no-install-recommends python3-coverage
  script:
    - python3-coverage run --append --source ./ -m unittest -v
      tests.unit_test_acme_dns_tiny
  artifacts:
    paths:
      - .coverage

29 30 31
.lets_encrypt_staging:
  stage: lets_encrypt_staging
  before_script:
32 33
    - *install_dependencies
    - apt-get install -y --no-install-recommends python3-coverage
34
  script:
35 36 37 38 39 40 41
    - python3-coverage run --append --source ./ -m unittest -v
      tests.staging_test_acme_dns_tiny
      tests.staging_test_acme_account_rollover
      tests.staging_test_acme_account_deactivate
  artifacts:
    paths:
      - .coverage
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
  only:
    - merge_requests
    - master

compile:
  extends: .check
  before_script:
    - apt-get update && apt-get install -y --no-install-recommends
      python3-minimal
  script:
    - python3 -m py_compile acme_dns_tiny.py tools/*.py tests/*.py

lint:
  extends: .check
  before_script:
57 58
    - *install_dependencies
    - apt-get install -y --no-install-recommends pylint3
59 60 61 62 63 64 65 66
  script:
    - pylint3 acme_dns_tiny.py
    - pylint3 tools/acme_account_deactivate.py
    - pylint3 tools/acme_account_rollover.py
    - pylint3 tests/config_factory.py
    - pylint3 tests/test_acme_dns_tiny.py
    - pylint3 tests/test_acme_account_deactivate.py

67 68 69 70 71 72 73 74 75 76 77 78
jessie_unit_tests:
  extends: .unit_test
  image: debian:jessie-slim

stretch_unit_tests:
  extends: .unit_test
  image: debian:stretch-slim

buster_unit_tests:
  extends: .unit_test
  image: debian:buster-slim

79 80 81 82 83 84 85 86 87 88 89
jessie:
  extends: .lets_encrypt_staging
  image: debian:jessie-slim

stretch:
  extends: .lets_encrypt_staging
  image: debian:stretch-slim

buster:
  extends: .lets_encrypt_staging
  image: debian:buster-slim
90 91 92 93 94 95
  after_script:
    - python3-coverage report
      --include=acme_dns_tiny.py
      --include=tools/acme_account_rollover.py
      --include=tools/acme_account_deactivate.py
    - python3-coverage html
96 97 98
  artifacts:
    paths:
     - htmlcov