diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml new file mode 100644 index 00000000..fe58a541 --- /dev/null +++ b/.github/workflows/sanity.yaml @@ -0,0 +1,56 @@ +--- +name: Ansible sanity +"on": + workflow_call: null +jobs: + tox-matrix: + name: Matrix Sanity + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: "${{github.event.pull_request.head.ref}}" + repository: "${{ github.event.pull_request.head.repo.full_name }}" + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: "Install tox-ansible, includes tox" + run: "python -m pip install tox-ansible" + - name: "Check for tox-ansible.ini file, else add default" + uses: ansible/ansible-content-actions/.github/actions/add_tox_ansible@main + - name: Generate matrix + id: generate-matrix + run: > + python -m tox --ansible --gh-matrix --matrix-scope sanity --conf + tox-ansible.ini + outputs: + envlist: "${{ steps.generate-matrix.outputs.envlist }}" + test: + needs: tox-matrix + strategy: + fail-fast: false + matrix: + entry: "${{ fromJson(needs.tox-matrix.outputs.envlist) }}" + name: "${{ matrix.entry.name }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.head.sha }}" + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "${{ matrix.entry.python }}" + - name: "Install tox-ansible, includes tox" + run: python -m pip install tox-ansible + - name: "Check for tox-ansible.ini file, else add default" + uses: ansible/ansible-content-actions/.github/actions/add_tox_ansible@main + - name: Run tox sanity tests + run: >- + echo "Running tox sanity tests for ${{ matrix.entry.name }}" + python -m tox --ansible -e ${{ matrix.entry.name }} --conf + tox-ansible.ini + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dedbc9e5..25e67440 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,52 +1,53 @@ --- name: CI concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true on: # yamllint disable-line rule:truthy pull_request: branches: [main] workflow_dispatch: schedule: - cron: 0 0 * * * jobs: changelog: uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main if: github.event_name == 'pull_request' build-import: uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main ansible-lint: uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main sanity: uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main + # uses: omnom62/vyos.vyos/.github/workflows/sanity.yaml@sanity-test-doc-fix unit-galaxy: uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main unit-source: uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main with: collection_pre_install: >- git+https://github.com/ansible-collections/ansible.utils.git git+https://github.com/ansible-collections/ansible.netcommon.git all_green: if: ${{ always() }} needs: - changelog - build-import - sanity - unit-galaxy - unit-source - ansible-lint runs-on: ubuntu-latest steps: - run: >- python -c "assert 'failure' not in set([ '${{ needs.changelog.result }}', '${{ needs.sanity.result }}', '${{ needs.unit-galaxy.result }}' '${{ needs.ansible-lint.result }}' '${{ needs.unit-source.result }}' ])" diff --git a/changelogs/fragments/sanity-devel-fix.yml b/changelogs/fragments/sanity-devel-fix.yml new file mode 100644 index 00000000..04731bc0 --- /dev/null +++ b/changelogs/fragments/sanity-devel-fix.yml @@ -0,0 +1,3 @@ +--- +trivial: + - vyos action plugin - Added ignore file to sanity check diff --git a/tests/sanity/ignore-2.20.txt b/tests/sanity/ignore-2.20.txt new file mode 100644 index 00000000..c835eef8 --- /dev/null +++ b/tests/sanity/ignore-2.20.txt @@ -0,0 +1 @@ +plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local`