Commit a2d5f8cf authored by Adrien Dorsaz's avatar Adrien Dorsaz

gitlab-ci: prepare to split jobs with unit test and staging test

parent e66a9444
stages: stages:
- check - check
- unit_test
- lets_encrypt_staging - lets_encrypt_staging
.install_dependencies: &install_dependencies
- apt-get update && apt-get install -y --no-install-recommends
python3-minimal python3-dnspython python3-requests
.check: .check:
stage: check stage: check
image: debian:buster-slim image: debian:buster-slim
...@@ -9,19 +14,31 @@ stages: ...@@ -9,19 +14,31 @@ stages:
- merge_requests - merge_requests
- master - master
.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
.lets_encrypt_staging: .lets_encrypt_staging:
stage: lets_encrypt_staging stage: lets_encrypt_staging
before_script: before_script:
- apt-get update && apt-get install -y --no-install-recommends - *install_dependencies
python3-minimal python3-dnspython python3-requests python3-coverage - apt-get install -y --no-install-recommends python3-coverage
script: script:
- python3-coverage run --source ./ -m unittest -v tests.test_acme_dns_tiny - python3-coverage run --append --source ./ -m unittest -v
tests.test_acme_account_rollover tests.test_acme_account_deactivate tests.staging_test_acme_dns_tiny
- python3-coverage report tests.staging_test_acme_account_rollover
--include=acme_dns_tiny.py tests.staging_test_acme_account_deactivate
--include=tools/acme_account_rollover.py artifacts:
--include=tools/acme_account_deactivate.py paths:
- python3-coverage html - .coverage
only: only:
- merge_requests - merge_requests
- master - master
...@@ -37,8 +54,8 @@ compile: ...@@ -37,8 +54,8 @@ compile:
lint: lint:
extends: .check extends: .check
before_script: before_script:
- apt-get update && apt-get install -y --no-install-recommends pylint3 - *install_dependencies
python3-minimal python3-dnspython python3-requests - apt-get install -y --no-install-recommends pylint3
script: script:
- pylint3 acme_dns_tiny.py - pylint3 acme_dns_tiny.py
- pylint3 tools/acme_account_deactivate.py - pylint3 tools/acme_account_deactivate.py
...@@ -47,6 +64,18 @@ lint: ...@@ -47,6 +64,18 @@ lint:
- pylint3 tests/test_acme_dns_tiny.py - pylint3 tests/test_acme_dns_tiny.py
- pylint3 tests/test_acme_account_deactivate.py - pylint3 tests/test_acme_account_deactivate.py
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
jessie: jessie:
extends: .lets_encrypt_staging extends: .lets_encrypt_staging
image: debian:jessie-slim image: debian:jessie-slim
...@@ -58,6 +87,12 @@ stretch: ...@@ -58,6 +87,12 @@ stretch:
buster: buster:
extends: .lets_encrypt_staging extends: .lets_encrypt_staging
image: debian:buster-slim image: debian:buster-slim
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
artifacts: artifacts:
paths: paths:
- htmlcov - htmlcov
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment