]> git.phdru.name Git - m_librarian.git/commitdiff
Merge branch 'github-actions'
authorOleg Broytman <phd@phdru.name>
Mon, 30 Aug 2021 06:28:55 +0000 (09:28 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 30 Aug 2021 06:28:55 +0000 (09:28 +0300)
.github/workflows/run-tests.yaml [new file with mode: 0644]
.travis.yml [deleted file]
devscripts/requirements/requirements_tests.txt
docs-ru/news.rst
docs/news.rst
tox.ini

diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml
new file mode 100644 (file)
index 0000000..76d8b09
--- /dev/null
@@ -0,0 +1,58 @@
+name: Run tests
+
+on: [push, pull_request]
+
+jobs:
+  run-tests:
+
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
+        include:
+        - os: ubuntu-latest
+          os-name: Linux
+          pip-cache-path: ~/.cache/pip
+        - os: macos-latest
+          os-name: OSX
+          pip-cache-path: ~/Library/Caches/pip
+        - os: windows-latest
+          os-name: w32
+          pip-cache-path: ~\AppData\Local\pip\Cache
+
+    name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
+    runs-on: ${{ matrix.os }}
+
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Cache pip
+        uses: actions/cache@v2
+        with:
+          path: ${{ matrix.pip-cache-path }}
+          key: ${{ runner.os }}-pip
+      - name: Install dependencies
+        run: |
+          python --version
+          python -m pip install --upgrade "pip<21.0" "setuptools<45" wheel
+          pip --version
+          python -m pip --version
+          python -m pip install --upgrade virtualenv tox
+      - name: Set TOXENV
+        run: |
+          import os, sys
+          pyver = '%d%d' % tuple(sys.version_info[:2])
+          toxenv = 'py%s-sqlite' % pyver
+          if os.name == 'posix':
+            toxenv += ',py%s-flake8' % pyver
+          elif os.name == 'nt':
+            toxenv += '-w32'
+          with open(os.environ['GITHUB_ENV'], 'a') as f:
+            f.write('TOXENV=' + toxenv + '\n')
+        shell: python
+      - name: Run tox
+        run: |
+          python -c "import os; print(os.environ['TOXENV'])"
+          python -m tox
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index ec960ba..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-os: linux
-
-dist: xenial
-
-language: python
-
-python:
-  - "2.7"
-
-cache: pip
-
-matrix:
-  include:
-  - python: "2.7"
-    env: TOXENV=py27
-  - python: "3.5"
-    env: TOXENV=py35
-  - python: "3.6"
-    env: TOXENV=py36
-  - python: "3.7"
-    env: TOXENV=py37
-  - python: "3.8"
-    env: TOXENV=py38
-  - python: "3.9"
-    env: TOXENV=py39
-  - python: "2.7"
-    env: TOXENV=py27-flake8
-  - python: "3.9"
-    env: TOXENV=py39-flake8
-
-install:
-  - travis_retry pip install --upgrade "pip<21" "setuptools<44" "tox>=3.15" ppu
-
-script:
-  - tox
-
-before_cache:
-  - remove-old-files.py -o 180 ~/.cache/pip
index 973ffbaca0ae703070c4568c68c0ab24b50e9f0d..935cc0875c25ddc8c5b2804e762063cbdb8ed6da 100644 (file)
@@ -2,5 +2,4 @@
 
 pytest < 5.0; python_version == '2.7' or python_version == '3.4'
 pytest; python_version >= '3.5'
-pytest-cov
 ppu
index ad2506169388c41296eb816dc9b3bc48a44485d0..62db28d1596b18e90d3b0e98689ab9b9f70a5c72 100644 (file)
 
 * Улучшение в web-интерфейсе: сделана ссылка на корень.
 
+* GitHub Actions.
+
+* Перестали использовать Travis CI.
+
 Версия 0.1.5 (2019-02-01)
 -------------------------
 
index 62e8ea9b31abdbeba701460151d8cf083469a620..8b8b2d0dbd78fb24df3dea18621516fd78854f0b 100644 (file)
@@ -1,7 +1,7 @@
 News
 ====
 
-Version 0.1.6 (2020-12-??)
+Version 0.1.6 (2021-08-??)
 --------------------------
 
 * Store lock file in a shared directory; use ``$UID`` as a suffix
@@ -9,6 +9,10 @@ Version 0.1.6 (2020-12-??)
 
 * Enhancement in web-ui: added a link to the root.
 
+* GitHub Actions.
+
+* Stop testing at Travis CI.
+
 Version 0.1.5 (2019-02-01)
 --------------------------
 
diff --git a/tox.ini b/tox.ini
index 4d2880983b24ce3b8978aa0e3b9cadbb2903f705..3440b2110989c1394060a73e81d71ca4ff6f225e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -19,24 +19,24 @@ deps =
     pip < 19.2
     setuptools < 44
     -rdevscripts/requirements/requirements_tests.txt
-passenv = CI TRAVIS TRAVIS_* APPVEYOR DISTUTILS_USE_SDK MSSdk INCLUDE LIB WINDIR
+passenv = CI APPVEYOR DISTUTILS_USE_SDK MSSdk INCLUDE LIB WINDIR
 setenv =
     VIRTUALENV_PIP = 19.1.1
-platform = linux
+platform = linux|darwin
 
 [testenv:{py27,py34,py35,py36,py37,py38,py39}-sqlite]
 commands =
     {[testenv]commands}
     -rm.py -f /tmp/test.sqdb
-    {envpython} -m pytest --cov=m_librarian -D sqlite:///tmp/test.sqdb
+    {envpython} -m pytest -D sqlite:///tmp/test.sqdb
 
 [testenv:{py27,py34,py35,py36,py37,py38,py39}-sqlite-w32]
 platform = win32
 commands =
     {[testenv]commands}
-    -rm.py -f C:/projects/m-librarian/test.sqdb
-    pytest --cov=m_librarian -D sqlite:/C:/projects/m-librarian/test.sqdb?debug=1
-    rm.py -f C:/projects/m-librarian/test.sqdb
+    -rm.py -f {env:TEMP}/test.sqdb
+    pytest -D sqlite:/{env:TEMP}/test.sqdb?debug=1
+    rm.py -f {env:TEMP}/test.sqdb
 
 # flake8
 [testenv:{py27,py34,py35,py36,py37,py38,py39}-flake8]
@@ -45,3 +45,12 @@ deps =
 commands =
     {[testenv]commands}
     flake8
+
+[gh-actions]
+python =
+    2.7: py27
+    3.5: py35
+    3.6: py36
+    3.7: py37
+    3.8: py38
+    3.9: py39