Преглед изворни кода

Run tests on Github Actions

Thomas Kluyver пре 4 година
родитељ
комит
d3bd800af4
2 измењених фајлова са 30 додато и 1 уклоњено
  1. 28 0
      .github/workflows/test.yml
  2. 2 1
      tox.ini

+ 28 - 0
.github/workflows/test.yml

@@ -0,0 +1,28 @@
+name: Test
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ 3.5, 3.6, 3.7, 3.8, 3.9, ]
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install tox tox-gh-actions codecov
+
+      - name: Run tests
+        run: tox -- -v
+
+      - name: Codecov upload
+        run: codecov

+ 2 - 1
tox.ini

@@ -4,6 +4,7 @@ envlist = python
 
 [testenv]
 deps = pytest
+       pytest-cov
        requests 
        requests_download
        distlib
@@ -11,7 +12,7 @@ deps = pytest
        yarg
        testpath
        responses
-commands = pytest nsist/tests {posargs}
+commands = pytest --cov=nsist nsist/tests {posargs}
 
 [testenv:notnetwork]
 commands = pytest -m "not network" nsist/tests {posargs}