Quellcode durchsuchen

Merge pull request #226 from barneysowood/tests-github-actions

Migrate Travis CI testing setup to GitHub actions
Barney Sowood vor 1 Jahr
Ursprung
Commit
b376591e4b
4 geänderte Dateien mit 81 neuen und 10 gelöschten Zeilen
  1. 21 0
      .github/workflows/flake8.yaml
  2. 49 0
      .github/workflows/test.yaml
  3. 5 4
      tests/requirements.txt
  4. 6 6
      tox.ini

+ 21 - 0
.github/workflows/flake8.yaml

@@ -0,0 +1,21 @@
+name: flake8 lint
+on:
+  push:
+  pull_request:
+
+jobs:
+  flake8-lint:
+    runs-on: ubuntu-20.04
+    name: flake8 lint
+    steps:
+      - name: Setup python for flake8
+        uses: actions/setup-python@v4
+        with:
+          python-version: "3.8"
+      - uses: actions/checkout@v3
+      - name: Install tox
+        run: python -m pip install tox
+      - name: Setup flake8
+        run: tox --notest -e flake8
+      - name: Run flake8
+        run: tox -e flake8

+ 49 - 0
.github/workflows/test.yaml

@@ -0,0 +1,49 @@
+name: test
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: "0 8 * * *"
+
+jobs:
+  test:
+    name: test ${{ matrix.py }} - ${{ matrix.netapi }} - ${{ matrix.salt }}
+    runs-on: ubuntu-20.04
+    strategy:
+      fail-fast: false
+      matrix:
+        py:
+          - "3.5"
+          - "3.6"
+          - "3.7"
+          - "3.8"
+        netapi:
+          - "cherrypy"
+          - "tornado"
+        salt:
+          - "v3004.2"
+          - "v3005.1"
+          - "master"
+        exclude:
+          - salt: master
+            py: "3.5"
+          - salt: master
+            py: "3.6"
+    steps:
+      - name: Setup python for test ${{ matrix.py }}
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.py }}
+      - uses: actions/checkout@v3
+      - name: Install setuptools_scm
+        run: python -m pip install setuptools_scm
+      - name: Install tox
+        run: python -m pip install tox
+      - name: Install dependencies
+        run: sudo apt update && sudo apt install -y libc6-dev libffi-dev gcc git openssh-server libzmq3-dev
+        env:
+          DEBIAN_FRONTEND: noninteractive
+      - name: Setup tests
+        run: tox --notest -e py${{ matrix.py }}-${{ matrix.netapi }}-${{ matrix.salt }}
+      - name: Run tests
+        run: tox -e py${{ matrix.py }}-${{ matrix.netapi }}-${{ matrix.salt }}

+ 5 - 4
tests/requirements.txt

@@ -2,9 +2,10 @@ mock
 pytest>=3.5.0,<4.0.0
 pytest-rerunfailures
 pytest-cov
-git+https://github.com/saltstack/pytest-salt@master#egg=pytest-salt
-tornado<5.0.0
+git+https://github.com/vmware-archive/pytest-salt@master#egg=pytest-salt
+tornado==6.1
 CherryPy
 setuptools_scm
-pyzmq>=2.2.0,<17.1.0; python_version == '3.4'  # pyzmq 17.1.0 stopped building wheels for python3.4
-pyzmq>=2.2.0; python_version != '3.4'
+pyzmq<=20.0.0 ; python_version < "3.6"
+pyzmq>=17.0.0 ; python_version < "3.9"
+pyzmq>19.0.2 ; python_version >= "3.9"

+ 6 - 6
tox.ini

@@ -1,14 +1,14 @@
 [tox]
-envlist = py{27,34,35,36,37,38}-{cherrypy,tornado}-{v2018.3,v2019.2,develop},coverage,flake8
+envlist = py{3.5,3.6,3.7,3.8}-{cherrypy,tornado}-{v3004.2,v3005.1,master},coverage,flake8
 skip_missing_interpreters = true
 skipsdist = false
 
 [testenv]
-passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_*
+passenv = TOXENV, CI, TRAVIS, TRAVIS_*, CODECOV_*
 deps = -r{toxinidir}/tests/requirements.txt
-    v2018.3: salt<2018.4
-    v2019.2: salt<2019.3
-    develop: git+https://github.com/saltstack/salt.git@develop#egg=salt
+    v3004.2: salt<3004.2
+    v3005.1: salt<3005.1
+    master: git+https://github.com/saltstack/salt.git@master#egg=salt
 
 changedir = {toxinidir}
 setenv = COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
@@ -25,7 +25,7 @@ commands = flake8 tests/ pepper/ scripts/pepper setup.py
 [testenv:coverage]
 skip_install = True
 deps =
-    coverage >= 4.4.1, < 5
+    coverage >= 7.0.5, < 8
 setenv = COVERAGE_FILE={toxworkdir}/.coverage
 changedir = {toxinidir}
 commands =