]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: use github workflow for pytest
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 23 Oct 2020 14:24:50 +0000 (10:24 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 18 Nov 2020 15:49:22 +0000 (10:49 -0500)
Move the pytest testing from TravisCI to Github workflow.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 3e79f0322a703003ab1af51104b69a1d2162951e)

.github/workflows/pytest.yml [new file with mode: 0644]
.travis.yml
tests/requirements.txt

diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
new file mode 100644 (file)
index 0000000..5ac5666
--- /dev/null
@@ -0,0 +1,24 @@
+name: pytest
+on:
+  pull_request:
+    paths:
+      - 'library/**.py'
+      - 'plugins/filter/**.py'
+      - 'tests/library/**.py'
+      - 'tests/plugins/filter/**.py'
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.6, 3.7, 3.8]
+    name: Python ${{ matrix.python-version }}
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup python
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+          architecture: x64
+      - run: pip install -r tests/requirements.txt
+      - run: pytest --cov=library/ --cov=plugins/filter/ -vvvv tests/library/ tests/plugins/filter/
index 6fce5deae7439e88e818e316ffbb893ca8a1925b..e8d4b2f4441141787f525c322852d115e0ba9d17 100644 (file)
@@ -7,8 +7,7 @@ notifications:
   webhooks: https://galaxy.ansible.com/api/v1/notifications/
 install:
   - pip install -r tests/requirements.txt
-  - pip install ansible-lint==4.2.0 pytest-cov
+  - pip install ansible-lint==4.2.0
 script:
   - if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi
-  - pytest --cov=library/ --cov=plugins/filter/ -vvvv tests/library/ tests/plugins/filter/
   - for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/; if [ $? -ne 0 ]; then exit 1; fi; done
index 04ada956be07de63b70a62c4138f00b150750df8..5af56f78066d08f893b9b2ef80d045085fcdbf8c 100644 (file)
@@ -9,3 +9,4 @@ netaddr
 mock
 jmespath
 pytest-rerunfailures<9.0
+pytest-cov