refactor: rework ci and testing #3
@ -7,7 +7,7 @@ local PythonVersion(pyversion='3.8') = {
|
|||||||
commands: [
|
commands: [
|
||||||
'pip install poetry -qq',
|
'pip install poetry -qq',
|
||||||
'poetry config experimental.new-installer false',
|
'poetry config experimental.new-installer false',
|
||||||
'poetry install',
|
'poetry install --all-extras',
|
||||||
'poetry run pytest',
|
'poetry run pytest',
|
||||||
],
|
],
|
||||||
depends_on: [
|
depends_on: [
|
||||||
@ -15,6 +15,25 @@ local PythonVersion(pyversion='3.8') = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
local AnsibleVersion(version='devel') = {
|
||||||
|
local gitversion = if version == 'devel' then 'devel' else 'stable-' + version,
|
||||||
|
name: 'ansible-' + std.strReplace(version, '.', ''),
|
||||||
|
image: 'python:3.8',
|
||||||
|
environment: {
|
||||||
|
PY_COLORS: 1,
|
||||||
|
},
|
||||||
|
commands: [
|
||||||
|
'pip install poetry -qq',
|
||||||
|
'poetry config experimental.new-installer false',
|
||||||
|
'poetry install',
|
||||||
|
'poetry run pip install https://github.com/ansible/ansible/archive/' + gitversion + '.tar.gz --disable-pip-version-check',
|
||||||
|
'ansible-test sanity --exclude .chglog/ --exclude .drone.yml --python 3.8',
|
||||||
|
],
|
||||||
|
depends_on: [
|
||||||
|
'clone',
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
local PipelineLint = {
|
local PipelineLint = {
|
||||||
kind: 'pipeline',
|
kind: 'pipeline',
|
||||||
name: 'lint',
|
name: 'lint',
|
||||||
@ -33,7 +52,7 @@ local PipelineLint = {
|
|||||||
'git fetch -tq',
|
'git fetch -tq',
|
||||||
'pip install poetry -qq',
|
'pip install poetry -qq',
|
||||||
'poetry config experimental.new-installer false',
|
'poetry config experimental.new-installer false',
|
||||||
'poetry install',
|
'poetry install --all-extras',
|
||||||
'poetry run yapf -dr ./plugins',
|
'poetry run yapf -dr ./plugins',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -47,7 +66,7 @@ local PipelineLint = {
|
|||||||
'git fetch -tq',
|
'git fetch -tq',
|
||||||
'pip install poetry -qq',
|
'pip install poetry -qq',
|
||||||
'poetry config experimental.new-installer false',
|
'poetry config experimental.new-installer false',
|
||||||
'poetry install',
|
'poetry install --all-extras',
|
||||||
'poetry run ruff ./plugins',
|
'poetry run ruff ./plugins',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -57,9 +76,9 @@ local PipelineLint = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
local PipelineTest = {
|
local PipelineUnitTest = {
|
||||||
kind: 'pipeline',
|
kind: 'pipeline',
|
||||||
name: 'test',
|
name: 'unit-test',
|
||||||
platform: {
|
platform: {
|
||||||
os: 'linux',
|
os: 'linux',
|
||||||
arch: 'amd64',
|
arch: 'amd64',
|
||||||
@ -78,6 +97,25 @@ local PipelineTest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
local PipelineSanityTest = {
|
||||||
|
kind: 'pipeline',
|
||||||
|
name: 'sanity-test',
|
||||||
|
platform: {
|
||||||
|
os: 'linux',
|
||||||
|
arch: 'amd64',
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
AnsibleVersion(version='devel'),
|
||||||
|
AnsibleVersion(version='2.14'),
|
||||||
|
],
|
||||||
|
depends_on: [
|
||||||
|
'unit-test',
|
||||||
|
],
|
||||||
|
trigger: {
|
||||||
|
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
local PipelineBuild = {
|
local PipelineBuild = {
|
||||||
kind: 'pipeline',
|
kind: 'pipeline',
|
||||||
name: 'build',
|
name: 'build',
|
||||||
@ -94,7 +132,7 @@ local PipelineBuild = {
|
|||||||
"sed -i 's/version: 0.0.0/version: '\"$${GALAXY_VERSION:-0.0.0}\"'/g' galaxy.yml",
|
"sed -i 's/version: 0.0.0/version: '\"$${GALAXY_VERSION:-0.0.0}\"'/g' galaxy.yml",
|
||||||
'pip install poetry -qq',
|
'pip install poetry -qq',
|
||||||
'poetry config experimental.new-installer false',
|
'poetry config experimental.new-installer false',
|
||||||
'poetry install',
|
'poetry install --all-extras',
|
||||||
'poetry run ansible-galaxy collection build --output-path dist/',
|
'poetry run ansible-galaxy collection build --output-path dist/',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -138,7 +176,7 @@ local PipelineBuild = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
depends_on: [
|
depends_on: [
|
||||||
'test',
|
'sanity-test',
|
||||||
],
|
],
|
||||||
trigger: {
|
trigger: {
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
||||||
@ -209,7 +247,8 @@ local PipelineNotifications = {
|
|||||||
|
|
||||||
[
|
[
|
||||||
PipelineLint,
|
PipelineLint,
|
||||||
PipelineTest,
|
PipelineUnitTest,
|
||||||
|
PipelineSanityTest,
|
||||||
PipelineBuild,
|
PipelineBuild,
|
||||||
PipelineDocumentation,
|
PipelineDocumentation,
|
||||||
PipelineNotifications,
|
PipelineNotifications,
|
||||||
|
64
.drone.yml
64
.drone.yml
@ -13,7 +13,7 @@ steps:
|
|||||||
- git fetch -tq
|
- git fetch -tq
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run yapf -dr ./plugins
|
- poetry run yapf -dr ./plugins
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -24,7 +24,7 @@ steps:
|
|||||||
- git fetch -tq
|
- git fetch -tq
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run ruff ./plugins
|
- poetry run ruff ./plugins
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -37,7 +37,7 @@ trigger:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: test
|
name: unit-test
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@ -49,7 +49,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run pytest
|
- poetry run pytest
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -61,7 +61,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run pytest
|
- poetry run pytest
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -73,7 +73,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run pytest
|
- poetry run pytest
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -85,7 +85,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run pytest
|
- poetry run pytest
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: 1
|
PY_COLORS: 1
|
||||||
@ -101,6 +101,50 @@ trigger:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- lint
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: sanity-test
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ansible-devel
|
||||||
|
image: python:3.8
|
||||||
|
commands:
|
||||||
|
- pip install poetry -qq
|
||||||
|
- poetry config experimental.new-installer false
|
||||||
|
- poetry install
|
||||||
|
- poetry run pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
|
||||||
|
- ansible-test sanity --exclude .chglog/ --exclude .drone.yml --python 3.8
|
||||||
|
environment:
|
||||||
|
PY_COLORS: 1
|
||||||
|
depends_on:
|
||||||
|
- clone
|
||||||
|
|
||||||
|
- name: ansible-214
|
||||||
|
image: python:3.8
|
||||||
|
commands:
|
||||||
|
- pip install poetry -qq
|
||||||
|
- poetry config experimental.new-installer false
|
||||||
|
- poetry install
|
||||||
|
- poetry run pip install https://github.com/ansible/ansible/archive/stable-2.14.tar.gz --disable-pip-version-check
|
||||||
|
- ansible-test sanity --exclude .chglog/ --exclude .drone.yml --python 3.8
|
||||||
|
environment:
|
||||||
|
PY_COLORS: 1
|
||||||
|
depends_on:
|
||||||
|
- clone
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/main
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- unit-test
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: build
|
name: build
|
||||||
@ -117,7 +161,7 @@ steps:
|
|||||||
- "sed -i 's/version: 0.0.0/version: '\"$${GALAXY_VERSION:-0.0.0}\"'/g' galaxy.yml"
|
- "sed -i 's/version: 0.0.0/version: '\"$${GALAXY_VERSION:-0.0.0}\"'/g' galaxy.yml"
|
||||||
- pip install poetry -qq
|
- pip install poetry -qq
|
||||||
- poetry config experimental.new-installer false
|
- poetry config experimental.new-installer false
|
||||||
- poetry install
|
- poetry install --all-extras
|
||||||
- poetry run ansible-galaxy collection build --output-path dist/
|
- poetry run ansible-galaxy collection build --output-path dist/
|
||||||
|
|
||||||
- name: checksum
|
- name: checksum
|
||||||
@ -160,7 +204,7 @@ trigger:
|
|||||||
- refs/pull/**
|
- refs/pull/**
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- test
|
- sanity-test
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -226,6 +270,6 @@ depends_on:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 73306cf1a763c7ef338c1418bf53fc5155fe5f0681ede8b9c93dbd245e560194
|
hmac: f8056d1063e4f27d6d1b2395518a9654a462b0291c5425b375442873d5e3a740
|
||||||
|
|
||||||
...
|
...
|
||||||
|
13
poetry.lock
generated
13
poetry.lock
generated
@ -5,7 +5,7 @@ name = "ansible-core"
|
|||||||
version = "2.13.7"
|
version = "2.13.7"
|
||||||
description = "Radically simple IT automation"
|
description = "Radically simple IT automation"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = true
|
||||||
python-versions = ">=3.8"
|
python-versions = ">=3.8"
|
||||||
files = [
|
files = [
|
||||||
{file = "ansible-core-2.13.7.tar.gz", hash = "sha256:a9d5f942ff0dcbeec3d7183a898ea4f656d233d6055d4bc8e22e37b013b1881a"},
|
{file = "ansible-core-2.13.7.tar.gz", hash = "sha256:a9d5f942ff0dcbeec3d7183a898ea4f656d233d6055d4bc8e22e37b013b1881a"},
|
||||||
@ -464,7 +464,7 @@ name = "jinja2"
|
|||||||
version = "3.1.2"
|
version = "3.1.2"
|
||||||
description = "A very fast and expressive template engine."
|
description = "A very fast and expressive template engine."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = true
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
files = [
|
files = [
|
||||||
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
|
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
|
||||||
@ -528,7 +528,7 @@ name = "markupsafe"
|
|||||||
version = "2.1.2"
|
version = "2.1.2"
|
||||||
description = "Safely add untrusted strings to HTML/XML markup."
|
description = "Safely add untrusted strings to HTML/XML markup."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = true
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
files = [
|
files = [
|
||||||
{file = "MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:665a36ae6f8f20a4676b53224e33d456a6f5a72657d9c83c2aa00765072f31f7"},
|
{file = "MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:665a36ae6f8f20a4676b53224e33d456a6f5a72657d9c83c2aa00765072f31f7"},
|
||||||
@ -886,7 +886,7 @@ name = "resolvelib"
|
|||||||
version = "0.8.1"
|
version = "0.8.1"
|
||||||
description = "Resolve abstract dependencies into concrete ones"
|
description = "Resolve abstract dependencies into concrete ones"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = true
|
||||||
python-versions = "*"
|
python-versions = "*"
|
||||||
files = [
|
files = [
|
||||||
{file = "resolvelib-0.8.1-py2.py3-none-any.whl", hash = "sha256:d9b7907f055c3b3a2cfc56c914ffd940122915826ff5fb5b1de0c99778f4de98"},
|
{file = "resolvelib-0.8.1-py2.py3-none-any.whl", hash = "sha256:d9b7907f055c3b3a2cfc56c914ffd940122915826ff5fb5b1de0c99778f4de98"},
|
||||||
@ -1134,7 +1134,10 @@ files = [
|
|||||||
{file = "yapf-0.32.0.tar.gz", hash = "sha256:a3f5085d37ef7e3e004c4ba9f9b3e40c54ff1901cd111f05145ae313a7c67d1b"},
|
{file = "yapf-0.32.0.tar.gz", hash = "sha256:a3f5085d37ef7e3e004c4ba9f9b3e40c54ff1901cd111f05145ae313a7c67d1b"},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[extras]
|
||||||
|
ansible = ["ansible-core"]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = "^3.8.0"
|
python-versions = "^3.8.0"
|
||||||
content-hash = "a0518f9a3a398dc6f5cdae9f83999d13d2e6dccaa92509ecff92fb80ccc4a0c1"
|
content-hash = "98070d85ac9a8d2718daf9130e63de51881f16453a59a5100a799492cc5ecdb4"
|
||||||
|
@ -27,11 +27,14 @@ version = "0.0.0"
|
|||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8.0"
|
python = "^3.8.0"
|
||||||
ansible-core = "<=2.14.0"
|
ansible-core = { version = "<=2.14.0", optional = true }
|
||||||
pyopenssl = "23.0.0"
|
pyopenssl = "23.0.0"
|
||||||
proxmoxer = "2.0.1"
|
proxmoxer = "2.0.1"
|
||||||
hcloud = "1.18.2"
|
hcloud = "1.18.2"
|
||||||
|
|
||||||
|
[tool.poetry.extras]
|
||||||
|
ansible = ["ansible-core"]
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
ruff = "0.0.230"
|
ruff = "0.0.230"
|
||||||
pytest = "7.2.1"
|
pytest = "7.2.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user