From 3a20c99f827c8d89d7937a79719094ad6b9e7481 Mon Sep 17 00:00:00 2001 From: Bodo Schulz Date: Mon, 19 Aug 2024 12:18:49 +0200 Subject: [PATCH] automatic update: test-requirements.txt tox.ini hooks/gh-clean Makefile --- Makefile | 7 +++-- hooks/gh-clean | 72 +++++++++++++++++++++++++++++++++++++++++++ test-requirements.txt | 3 +- tox.ini | 8 +++-- 4 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 hooks/gh-clean diff --git a/Makefile b/Makefile index 3abaf48..5430887 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # export TOX_SCENARIO ?= default -export TOX_ANSIBLE ?= ansible_6.1 +export TOX_ANSIBLE ?= ansible_8.5 -.PHONY: converge destroy verify test lint +.PHONY: converge destroy verify test lint gh-clean default: converge @@ -20,3 +20,6 @@ test: lint: @hooks/lint + +gh-clean: + @hooks/gh-clean diff --git a/hooks/gh-clean b/hooks/gh-clean new file mode 100644 index 0000000..4605d95 --- /dev/null +++ b/hooks/gh-clean @@ -0,0 +1,72 @@ +#!/bin/bash + +set -e + +org=bodsch +repo=$(basename $(git rev-parse --show-toplevel)) + +keep_first_two() { + local arr=("$@") # Das Array wird als Argument übergeben + local new_arr=("${arr[@]:0:2}") # Die ersten beiden Elemente werden beibehalten + echo "${new_arr[@]}" # Das neue Array wird ausgegeben +} + +remove_elements() { + local arr=("$@") + local result=() + local length=${#arr[@]} + + # Check whether the array has more than two elements + if [ $length -le 2 ] + then + return + fi + + # Keep the first two elements + for ((i=2; i/dev/null + done + + echo "-------------------------------------------------" + fi + done +else + echo "missing values:" + echo " - org : '${org}'" + echo " - repo: '${repo}'" + + exit 1 +fi diff --git a/test-requirements.txt b/test-requirements.txt index 267ec92..dc5c9a1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,10 +2,9 @@ ansible-lint docker dnspython flake8 -molecule>=5.0.1 +molecule molecule-plugins[docker] netaddr -pytest pytest-testinfra tox tox-gh-actions diff --git a/tox.ini b/tox.ini index a485358..c3099d3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] +ignore_basepython_conflict = True +skip_missing_interpreters = True + minversion = 3.25 toxworkdir = /tmp/.tox/ -envlist = ansible_{2.9,2.10,3.4,4.10,5.1,5.2,6.1} - skipsdist = true [testenv] @@ -26,6 +27,9 @@ deps = ansible_7.5: ansible>=7.5,<7.6 ansible_8.0: ansible>=8.0,<8.1 ansible_8.5: ansible>=8.5,<8.6 + ansible_9.0: ansible>=9.0,<9.1 + ansible_9.5: ansible>=9.5,<9.6 + ansible_10.0: ansible>=10.0,<10.1 #commands_pre = # /usr/bin/find {toxinidir} -type f -not -path '{toxworkdir}/*' -path '*/__pycache__/*' -name '*.py[c|o]' -delete