diff options
author | GomathiselviS <gomathiselvi@gmail.com> | 2022-06-16 10:31:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 10:31:25 +0530 |
commit | e66c1e127c7226167e648d7778a7c2a71b71f58d (patch) | |
tree | acd6573ef61392e4a96994877f71da759c809f51 | |
parent | 2c62d6d43189f8b79ffa9843923fab0c9633370e (diff) | |
download | vyos.vyos-e66c1e127c7226167e648d7778a7c2a71b71f58d.tar.gz vyos.vyos-e66c1e127c7226167e648d7778a7c2a71b71f58d.zip |
Enable github actions for unit and sanity tests (#263)
Signed-off-by: GomathiselviS <gomathiselvi@gmail.com>
-rw-r--r-- | .github/workflows/tests.yml | 41 | ||||
-rw-r--r-- | changelogs/fragments/gha.yaml | 3 | ||||
-rw-r--r-- | pyproject.toml | 7 | ||||
-rw-r--r-- | test-requirements.txt | 1 |
4 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..0a25f48b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,41 @@ +--- +name: Test collection + +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + +on: # yamllint disable-line rule:truthy + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + changelog: + uses: ansible-network/github_actions/.github/workflows/changelog.yml@main + sanity: + uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + unit-galaxy: + uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@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 + - sanity + - unit-galaxy + - unit-source + runs-on: ubuntu-latest + steps: + - run: >- + python -c "assert set([ + '${{ needs.changelog.result }}', + '${{ needs.sanity.result }}', + '${{ needs.unit-galaxy.result }}', + '${{ needs.unit-source.result }}' + ]) == {'success'}" diff --git a/changelogs/fragments/gha.yaml b/changelogs/fragments/gha.yaml new file mode 100644 index 00000000..2d667e47 --- /dev/null +++ b/changelogs/fragments/gha.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Enable unit and sanity tests using Github actions diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..4b00287e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[tool.black] +line-length = 79 + +[tool.pytest.ini_options] +addopts = ["-vvv", "-n", "2", "--log-level", "WARNING", "--color", "yes"] +testpaths = ["tests"] +filterwarnings = ['ignore:AnsibleCollectionFinder has already been configured'] diff --git a/test-requirements.txt b/test-requirements.txt index 5baa1387..8359fc53 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,3 +5,4 @@ pexpect pytest-xdist yamllint coverage==4.5.4 +git+https://github.com/ansible-community/pytest-ansible-units.git |