diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6eb706..537675d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: molecule_tests: required: true type: string + root_permission_varname: + required: false + type: string sanity_includes: required: false type: string @@ -16,37 +19,7 @@ on: sanity_excludes: required: false type: string - default: >- - [ - { - "python_version": "3.9", - "ansible_version": "stable-2.16" - }, - { - "python_version": "3.9", - "ansible_version": "milestone" - }, - { - "python_version": "3.9", - "ansible_version": "devel" - }, - { - "python_version": "3.11", - "ansible_version": "milestone" - }, - { - "python_version": "3.11", - "ansible_version": "devel" - }, - { - "python_version": "3.12", - "ansible_version": "stable-2.15" - }, - { - "python_version": "3.12", - "ansible_version": "stable-2.16" - } - ] + default: "[]" fail_fast: required: false type: boolean @@ -67,8 +40,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.11"] - ansible_version: ["2.16"] + python_version: ["3.12"] + ansible_version: ["2.18", "2.19", "2.20"] steps: - name: Check out code uses: actions/checkout@v4 @@ -118,8 +91,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.9", "3.11", "3.12"] - ansible_version: ["stable-2.15", "stable-2.16", "milestone", "devel"] + python_version: ["3.12"] + ansible_version: ["stable-2.18", "stable-2.19", "stable-2.20"] exclude: ${{ fromJSON(inputs.sanity_excludes) }} include: ${{ fromJSON(inputs.sanity_includes) }} steps: @@ -168,8 +141,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.11"] - ansible_version: ["2.15", "2.16"] + python_version: ["3.12"] + ansible_version: ["2.18", "2.19", "2.20"] molecule_test: ${{ fromJSON(inputs.molecule_tests) }} fail-fast: ${{ inputs.fail_fast }} steps: @@ -213,7 +186,7 @@ jobs: - name: Run molecule test run: | molecule --version - molecule test -s ${{ matrix.molecule_test }} + molecule test -s ${{ matrix.molecule_test }} -- -e ${{ inputs.root_permission_varname }}=false working-directory: ./ansible_collections/${{ inputs.fqcn }} env: ANSIBLE_VERBOSITY: ${{ inputs.debug_verbosity }} diff --git a/.github/workflows/cish.yml b/.github/workflows/cish.yml index 3020bca..aef9334 100644 --- a/.github/workflows/cish.yml +++ b/.github/workflows/cish.yml @@ -9,9 +9,15 @@ on: molecule_tests: required: true type: string + root_permission_varname: + required: false + type: string podman_tests_current: required: true type: string + podman_tests_middle: + required: true + type: string podman_tests_next: required: true type: string @@ -22,37 +28,7 @@ on: sanity_excludes: required: false type: string - default: >- - [ - { - "python_version": "3.9", - "ansible_version": "stable-2.16" - }, - { - "python_version": "3.9", - "ansible_version": "milestone" - }, - { - "python_version": "3.9", - "ansible_version": "devel" - }, - { - "python_version": "3.11", - "ansible_version": "milestone" - }, - { - "python_version": "3.11", - "ansible_version": "devel" - }, - { - "python_version": "3.12", - "ansible_version": "stable-2.15" - }, - { - "python_version": "3.12", - "ansible_version": "stable-2.16" - } - ] + default: "[]" fail_fast: required: false type: boolean @@ -73,8 +49,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.11"] - ansible_version: ["2.16"] + python_version: ["3.12"] + ansible_version: ["2.18", "2.19", "2.20"] steps: - name: Check out code uses: actions/checkout@v4 @@ -124,8 +100,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.9", "3.11", "3.12"] - ansible_version: ["stable-2.15", "stable-2.16", "milestone", "devel"] + python_version: ["3.12"] + ansible_version: ["stable-2.18", "stable-2.19", "stable-2.20", "milestone", "devel"] exclude: ${{ fromJSON(inputs.sanity_excludes) }} include: ${{ fromJSON(inputs.sanity_includes) }} steps: @@ -174,8 +150,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ["3.11"] - ansible_version: ["2.15", "2.16"] + python_version: ["3.12"] + ansible_version: ["2.18", "2.19", "2.20"] molecule_test: ${{ fromJSON(inputs.molecule_tests) }} fail-fast: ${{ inputs.fail_fast }} steps: @@ -219,7 +195,7 @@ jobs: - name: Run molecule test run: | molecule --version - molecule test -s ${{ matrix.molecule_test }} + molecule test -s ${{ matrix.molecule_test }} -- -e ${{ inputs.root_permission_varname }}=false working-directory: ./ansible_collections/${{ inputs.fqcn }} env: ANSIBLE_VERBOSITY: ${{ inputs.debug_verbosity }} @@ -229,10 +205,10 @@ jobs: STAGE_JBOSSNETWORK_API_SECRET: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' molecule_current: - runs-on: molecule-2.15 + runs-on: molecule-2.18 strategy: matrix: - python_version: ["3.11"] + python_version: ["3.12"] molecule_test: ${{ fromJSON(inputs.podman_tests_current) }} fail-fast: ${{ inputs.fail_fast }} steps: @@ -248,10 +224,59 @@ jobs: retry_wait_seconds: 60 max_attempts: 3 command: | - python3.11 -m pip install --upgrade pip + python3.12 -m pip install --upgrade pip + if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.txt ]; then + echo "=== Installing python deps" + python3.12 -m pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt + fi + if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.yml ]; then + echo "=== Installing dependencies" + ansible-galaxy collection install -r ansible_collections/${{ inputs.fqcn }}/requirements.yml -p /home/runner/.ansible/collections --force-with-deps + fi + if [ -f ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml ]; then + echo "=== Installing test dependencies" + ansible-galaxy role install -r ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml ||: + ansible-galaxy collection install -r ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml -p /home/runner/.ansible/collections + fi + exit 0 + + - name: Run molecule test + run: | + molecule --version + molecule test -s ${{ matrix.molecule_test }} -- -e ${{ inputs.root_permission_varname }}=false + working-directory: ./ansible_collections/${{ inputs.fqcn }} + env: + ANSIBLE_REMOTE_TMP: "/tmp-2.18-${{ matrix.molecule_test }}" + ANSIBLE_VERBOSITY: ${{ inputs.debug_verbosity }} + PROD_JBOSSNETWORK_API_CLIENTID: '${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}' + PROD_JBOSSNETWORK_API_SECRET: '${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}' + STAGE_JBOSSNETWORK_API_CLIENTID: '${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}' + STAGE_JBOSSNETWORK_API_SECRET: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' + + molecule_middle: + runs-on: molecule-2.19 + strategy: + matrix: + python_version: ["3.12"] + molecule_test: ${{ fromJSON(inputs.podman_tests_middle) }} + fail-fast: ${{ inputs.fail_fast }} + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + path: ansible_collections/${{ inputs.fqcn }} + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + retry_wait_seconds: 60 + max_attempts: 3 + command: | + python3.12 -m pip install --upgrade pip if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.txt ]; then echo "=== Installing python deps" - python3.11 -m pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt + python3.12 -m pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt fi if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.yml ]; then echo "=== Installing dependencies" @@ -267,21 +292,23 @@ jobs: - name: Run molecule test run: | molecule --version - molecule test -s ${{ matrix.molecule_test }} + molecule test -s ${{ matrix.molecule_test }} -- -e ${{ inputs.root_permission_varname }}=false working-directory: ./ansible_collections/${{ inputs.fqcn }} env: - ANSIBLE_REMOTE_TMP: "/tmp-2.15-${{ matrix.molecule_test }}" + ANSIBLE_REMOTE_TMP: "/tmp-2.19-${{ matrix.molecule_test }}" ANSIBLE_VERBOSITY: ${{ inputs.debug_verbosity }} PROD_JBOSSNETWORK_API_CLIENTID: '${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}' PROD_JBOSSNETWORK_API_SECRET: '${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}' STAGE_JBOSSNETWORK_API_CLIENTID: '${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}' STAGE_JBOSSNETWORK_API_SECRET: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' + PROXY: '10.88.0.1:3128' + NO_PROXY: 'localhost,.redhat.com,.ansible.com' molecule_next: - runs-on: molecule-2.16 + runs-on: molecule-2.20 strategy: matrix: - python_version: ["3.11"] + python_version: ["3.12"] molecule_test: ${{ fromJSON(inputs.podman_tests_next) }} fail-fast: ${{ inputs.fail_fast }} steps: @@ -297,10 +324,10 @@ jobs: retry_wait_seconds: 60 max_attempts: 3 command: | - python3.11 -m pip install --upgrade pip + python3.12 -m pip install --upgrade pip if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.txt ]; then echo "=== Installing python deps" - python3.11 -m pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt + python3.12 -m pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt fi if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.yml ]; then echo "=== Installing dependencies" @@ -316,12 +343,14 @@ jobs: - name: Run molecule test run: | molecule --version - molecule test -s ${{ matrix.molecule_test }} + molecule test -s ${{ matrix.molecule_test }} -- -e ${{ inputs.root_permission_varname }}=false working-directory: ./ansible_collections/${{ inputs.fqcn }} env: - ANSIBLE_REMOTE_TMP: "/tmp-2.16-${{ matrix.molecule_test }}" + ANSIBLE_REMOTE_TMP: "/tmp-2.20-${{ matrix.molecule_test }}" ANSIBLE_VERBOSITY: ${{ inputs.debug_verbosity }} PROD_JBOSSNETWORK_API_CLIENTID: '${{ secrets.PROD_JBOSSNETWORK_API_CLIENTID }}' PROD_JBOSSNETWORK_API_SECRET: '${{ secrets.PROD_JBOSSNETWORK_API_SECRET }}' STAGE_JBOSSNETWORK_API_CLIENTID: '${{ secrets.STAGE_JBOSSNETWORK_API_CLIENTID }}' STAGE_JBOSSNETWORK_API_SECRET: '${{ secrets.STAGE_JBOSSNETWORK_API_SECRET }}' + PROXY: '10.88.0.1:3128' + NO_PROXY: 'localhost,.redhat.com,.ansible.com' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ad3f79d..27b3e78 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -39,7 +39,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 cache: 'pip' - name: Install doc dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ec3492..8e33cbd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: 'pip' - name: Get current version