fix: use actual registry instead of clean for imagetools #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | ||
| name: Ansible Test | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| testing-type: | ||
| type: string | ||
| required: true | ||
| collection: | ||
| type: string | ||
| required: true | ||
| jobs: | ||
| test: | ||
| strategy: | ||
| matrix: | ||
| python_version: | ||
| - "3.9" | ||
| - "3.12" | ||
| ansible_version: | ||
| - "8.7.0" | ||
| - "9.0.1" | ||
| exclude: | ||
| - python_base_version: "3.12" | ||
| ansible_version: "8.7.0" | ||
| name: Run ${{ inputs.testing-type }} tests on Ansible ${{ matrix.ansible_version }} and Python ${{ matrix.python_version }} | ||
| runs-on: ubuntu-latest | ||
| container: registry.famedly.net/docker-oss/ansible:py-${{ matrix.python_version }}-ansible-${{ matrix.ansible_version }} | ||
| env: | ||
| TESTING_PATH: ${{ inputs.testing-type == 'units' && 'unit' || inputs.testing-type }} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| working-directory: "ansible_collections/${{ inputs.collection }}" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| path: "ansible_collections/${{ inputs.collection }}" | ||
| - name: Prepare env | ||
| run: | | ||
| echo "HAS_TESTS=$([[ -d "tests/${{ env.TESTING_PATH }}" ]] && echo true || echo false )" >> $GITHUB_ENV | ||
| - name: Prepare exclude | ||
| if: inputs.testing-type != 'units' | ||
| run: | | ||
| export SUBMODULES=$(for path in $(git submodule --quiet foreach pwd); do echo "${path#$(pwd)/}/"; done) | ||
| echo "EXCLUDE=${SUBMODULES:+--exclude ${SUBMODULES}}" >> $GITHUB_ENV | ||
| - name: Run tests | ||
| id: test | ||
| if: env.HAS_TESTS == 'true' # Yes, this is neccessary, because github converts this to a string and the string `false` is considered truthy... | ||
| run: | | ||
| ansible-test ${{ inputs.testing-type }} --coverage ${{ env.EXCLUDE }} | ||
| - name: Generate coverage report | ||
| if: env.HAS_TESTS == 'true' # Yes, this is neccessary, because github converts this to a string and the string `false` is considered truthy... | ||
| run: | | ||
| ansible-test coverage report | ||
| ansible-test coverage xml | ||
| - name: Upload test artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ansible-test-${{ env.TESTING_PATH }}-${{ matrix.ansible_version }}-${{ matrix.python_version }} | ||
| path: "ansible_collections/${{ inputs.collection }}/tests/output/" | ||
| if-no-files-found: ignore | ||