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

Merge pull request #218 from takluyver/gh-actions

Switch from Travis CI to Github Actions
Thomas Kluyver пре 4 година
родитељ
комит
89431e7c38
5 измењених фајлова са 46 додато и 18 уклоњено
  1. 6 2
      .coveragerc
  2. 28 0
      .github/workflows/test.yml
  3. 0 14
      .travis.yml
  4. 2 1
      appveyor.yml
  5. 10 1
      tox.ini

+ 6 - 2
.coveragerc

@@ -1,5 +1,9 @@
 [run]
 omit = 
-    nsist/tests/*
-    nsist/_system_path.py
+    */tests/*
+    */nsist/_system_path.py
 
+[paths]
+package =
+    nsist/
+    */site-packages/nsist

+ 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

+ 0 - 14
.travis.yml

@@ -1,14 +0,0 @@
-language: python
-python:
-  - "3.9-dev"
-  - "3.8"
-  - "3.7"
-  - "3.6"
-  - "3.5"
-
-# Ensure dependencies are installed
-install:
-  - pip install --upgrade tox-travis tox virtualenv
-
-# Command to run tests
-script: tox -e python -- -v

+ 2 - 1
appveyor.yml

@@ -9,9 +9,10 @@ environment:
 
 install:
   - cinst nsis
-  - "%PYTHON%\\python.exe -m pip install -U tox virtualenv --no-warn-script-location"
+  - "%PYTHON%\\python.exe -m pip install -U tox virtualenv codecov --no-warn-script-location"
 
 build: off
 
 test_script:
   - "%PYTHON%\\python.exe -m tox -e python -- -v"
+  - "%PYTHON%\\python.exe -m codecov"

+ 10 - 1
tox.ini

@@ -2,8 +2,17 @@
 isolated_build = True
 envlist = python
 
+[gh-actions]
+python =
+    3.5: python
+    3.6: python
+    3.7: python
+    3.8: python
+    3.9: python
+
 [testenv]
 deps = pytest
+       pytest-cov
        requests 
        requests_download
        distlib
@@ -11,7 +20,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}