From 1d4501e306ba136cfaecbb696ccf943ef98d5490 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 13 Dec 2023 09:31:35 +0100 Subject: [PATCH] avoid matrix builds for better readability --- .woodpecker/build-package.yml | 1 - .woodpecker/sanity-test.yml | 44 ++++++++++++++++++++++++----------- .woodpecker/unit-test.yml | 32 +++++++++++++++++-------- 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/.woodpecker/build-package.yml b/.woodpecker/build-package.yml index 8b56832..1f32349 100644 --- a/.woodpecker/build-package.yml +++ b/.woodpecker/build-package.yml @@ -45,6 +45,5 @@ steps: - event: [tag] depends_on: - - lint - unit-test - sanity-test diff --git a/.woodpecker/sanity-test.yml b/.woodpecker/sanity-test.yml index 054bd1f..6933a6d 100644 --- a/.woodpecker/sanity-test.yml +++ b/.woodpecker/sanity-test.yml @@ -5,24 +5,40 @@ when: branch: - ${CI_REPO_DEFAULT_BRANCH} -matrix: - ANSIBLE_VERSION: - - "devel" - - "2.16" - - "2.15" - -workspace: - base: /woodpecker/src/ansible_collections/${CI_REPO_NAME/./\/} - path: src/github.com/octocat/hello-world - -steps: - ansible: +variables: + - &ansible_base image: docker.io/library/python:3.10 commands: - pip install poetry -qq - poetry install --all-extras --no-root - - poetry run pip install https://github.com/ansible/ansible/archive/${ANSIBLE_VERSION}.tar.gz --disable-pip-version-check + - poetry run pip install https://github.com/ansible/ansible/archive/$${ANSIBLE_VERSION}.tar.gz --disable-pip-version-check - poetry run ansible --version - poetry run ansible-test sanity --exclude .gitsv/ --exclude .woodpecker/ --python 3.10 + - &ansible_env + PY_COLORS: "1" + +workspace: + base: /woodpecker/src + path: ansible_collections/${CI_REPO_NAME/./\/} + +steps: + ansible-devel: + <<: *ansible_base environment: - PY_COLORS: "1" + ANSIBLE_VERSION: "devel" + <<: *ansible_env + + ansible-216: + <<: *ansible_base + environment: + ANSIBLE_VERSION: "stable-2.16" + <<: *ansible_env + + ansible-215: + <<: *ansible_base + environment: + ANSIBLE_VERSION: "stable-2.15" + <<: *ansible_env + +depends_on: + - lint diff --git a/.woodpecker/unit-test.yml b/.woodpecker/unit-test.yml index d2c0aea..bb840c4 100644 --- a/.woodpecker/unit-test.yml +++ b/.woodpecker/unit-test.yml @@ -5,16 +5,8 @@ when: branch: - ${CI_REPO_DEFAULT_BRANCH} -matrix: - PYTHON_VERSION: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - -steps: - pytest: - image: docker.io/library/python:${PYTHON_VERSION} +variables: + - &pytest_base commands: - git fetch --depth=2147483647 - pip install poetry -qq @@ -22,3 +14,23 @@ steps: - poetry run pytest environment: PY_COLORS: "1" + +steps: + pyton-312: + image: docker.io/library/python:python:3.12 + <<: *pytest_base + + pyton-311: + image: docker.io/library/python:python:3.11 + <<: *pytest_base + + pyton-310: + image: docker.io/library/python:python:3.10 + <<: *pytest_base + + pyton-39: + image: docker.io/library/python:python:3.9 + <<: *pytest_base + +depends_on: + - lint