|
| 1 | +--- |
| 2 | +# This workflow calls the latest version of the |
| 3 | +# reusable workflow. |
| 4 | +# You can copy this file into your respository if |
| 5 | +# you want to check against pinned versions of |
| 6 | +# Automation Hub tests. |
| 7 | +name: Run collection certification checks |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +on: |
| 13 | + pull_request: |
| 14 | + push: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: cert-ver-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +env: |
| 24 | + LSR_ROLE2COLL_NAMESPACE: fedora |
| 25 | + LSR_ROLE2COLL_NAME: linux_system_roles |
| 26 | + |
| 27 | +# Files that are not related to the core functionality |
| 28 | +# of your collection can cause Ansible Lint to fail. |
| 29 | +# If this happens, add an .ansible-lint file that includes |
| 30 | +# those files and directories to the root of your |
| 31 | +# repository; for example: |
| 32 | +# https://github.com/ansible-collections/partner-certification-checker/blob/main/.ansible-lint |
| 33 | +# https://github.com/ansible-collections/partner-certification-checker/blob/main/.ansible-lint |
| 34 | + |
| 35 | +# If there are sanity test failures that cannot be fixed and are allowed to ignore |
| 36 | +# https://docs.ansible.com/projects/lint/rules/sanity/, create a sanity ignore file |
| 37 | +# https://docs.ansible.com/projects/ansible/devel/dev_guide/testing/sanity/ignores.html#ignore-file-location |
| 38 | +# for each affected version of ansible-core (for example, `tests/sanity/ignore-2.18.txt`) and add corresponding entries. |
| 39 | +jobs: |
| 40 | + prep: |
| 41 | + if: | |
| 42 | + !((github.event_name == 'pull_request' && contains(github.event.pull_request.title, '[citest_skip]')) || |
| 43 | + (github.event_name == 'push' && contains(github.event.head_commit.message, '[citest_skip]'))) |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Update pip, git |
| 47 | + run: | |
| 48 | + set -euxo pipefail |
| 49 | + python3 -m pip install --upgrade pip |
| 50 | + sudo apt update |
| 51 | + sudo apt install -y git |
| 52 | +
|
| 53 | + - name: Checkout repo |
| 54 | + uses: actions/checkout@v6 |
| 55 | + |
| 56 | + - name: Install tox, tox-lsr |
| 57 | + run: | |
| 58 | + set -euxo pipefail |
| 59 | + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.17.1" |
| 60 | +
|
| 61 | + - name: Convert role to collection format |
| 62 | + run: | |
| 63 | + set -euxo pipefail |
| 64 | + TOXENV=collection lsr_ci_runtox |
| 65 | + call: |
| 66 | + if: | |
| 67 | + !((github.event_name == 'pull_request' && contains(github.event.pull_request.title, '[citest_skip]')) || |
| 68 | + (github.event_name == 'push' && contains(github.event.head_commit.message, '[citest_skip]'))) |
| 69 | + needs: prep |
| 70 | + uses: ansible-collections/partner-certification-checker/.github/workflows/certification-reusable.yml@2f6d9300ebe9190da3120a740c3a4d5ca2f0f02e # v1.0.0 |
| 71 | + # If the minimal Ansible Core version your collection supports Ansible |
| 72 | + # is greater than 2.16.0, specify it below. |
| 73 | + # You might also have to specify Python version supported by that version, |
| 74 | + # see https://docs.ansible.com/projects/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix |
| 75 | + # with: |
| 76 | + # ansible-core-version: '2.17.0' |
| 77 | + # python-versions: '["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]' |
| 78 | + with: |
| 79 | + collection-root: ${{ github.workspace }}/.tox/ansible_collections/fedora/linux_system_roles |
0 commit comments