From a0e45be6919af985aa1b7f33c8f4ae89edc3eca6 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sat, 14 Sep 2024 21:09:31 +0200 Subject: [PATCH] ci: test ansible-test action --- .gitea/workflows/pull-request-open.yml | 28 +++++++++----------------- tests/{ => unit}/requirements.txt | 0 2 files changed, 10 insertions(+), 18 deletions(-) rename tests/{ => unit}/requirements.txt (100%) diff --git a/.gitea/workflows/pull-request-open.yml b/.gitea/workflows/pull-request-open.yml index fd9d3ff..a203c7f 100644 --- a/.gitea/workflows/pull-request-open.yml +++ b/.gitea/workflows/pull-request-open.yml @@ -41,22 +41,14 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install requirements - run: pip3 install -r tests/requirements.txt - shell: bash - working-directory: ${{ gitea.workspace }} + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.10" - - name: Setup testing environment - run: ansible-galaxy collection install ${{ gitea.workspace }} - shell: bash - working-directory: ${{ gitea.workspace }} - - - name: Run ansible unit tests - run: ansible-test units --coverage - shell: bash - working-directory: ${{ gitea.workspace }} - - - name: Print coverage informations - run: ansible-test coverage report - shell: bash - working-directory: ${{ gitea.workspace }} + - name: Run unit tests + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + ansible-core-version: stable-2.14 + target-python-version: 3.10 + testing-type: units diff --git a/tests/requirements.txt b/tests/unit/requirements.txt similarity index 100% rename from tests/requirements.txt rename to tests/unit/requirements.txt