From 4faba3e08a02d5bb576a69dffa85c4943dc11cdb Mon Sep 17 00:00:00 2001 From: Sagar Paul Date: Thu, 11 May 2023 18:23:25 +0530 Subject: [PATCH] Enable periodic test runs via GHA (#261) * cron job and test req * revert check --- .github/workflows/test.yml | 8 +++++--- test-requirements.txt | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b378e37..f70a9ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,15 @@ name: Test collection concurrency: - group: ${{ github.head_ref }} + group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true -on: +on: # yamllint disable-line rule:truthy pull_request: branches: [main] workflow_dispatch: + schedule: + - cron: '0 0 * * *' jobs: changelog: @@ -20,7 +22,7 @@ jobs: uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main all_green: - if: ${{ always() }} + if: ${{ always() && (github.event_name != 'schedule') }} needs: - changelog - integration diff --git a/test-requirements.txt b/test-requirements.txt index 80779eb..4e77e6b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,10 +1,15 @@ -black==22.3.0 ; python_version > '3.5' -coverage==4.5.4 +# For ansible-tox-linters +black==23.3.0 ; python_version >= '3.7' flake8 -git+https://github.com/ansible-network/pytest-ansible-network-integration.git -git+https://github.com/ansible-community/pytest-ansible-units.git -ipaddress ; python_version < '3.0' -mock ; python_version < '3.5' -pytest-xdist yamllint + +# Unit test runner +pytest-ansible ; python_version >= '3.9' +git+https://github.com/ansible-community/pytest-ansible-units.git ; python_version < '3.9' +pytest-xdist + +# For integration tests +pexpect +git+https://github.com/ansible-network/pytest-ansible-network-integration.git +ipaddress ; python_version < '3.0' netaddr