diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7624aa1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel --universal + twine upload dist/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..b420de5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,82 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.8] + plattform: ["Python"] + include: + - python-version: 3.8 + plattform: "Jython" + jython: org.python:jython-installer:2.7.2 + toxenv: "jython-driver-{hsqldb,mock}" + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Maven cache + uses: actions/cache@v1 + with: + path: .tox/shared/.m2 + key: ${{ matrix.plattform }}-${{ matrix.python-version }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ matrix.plattform }}-${{ matrix.python-version }}-maven- + - name: Pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ matrix.plattform }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/*requirements.txt', 'tox.ini', 'setup.py') }} + restore-keys: | + ${{ matrix.plattform }}-${{ matrix.python-version }}-pip- + - name: Jython installation cache + uses: actions/cache@v2 + with: + path: ~/jython + key: ${{ matrix.jython }}-jython + if: matrix.jython + + - name: Consider Jython + run: | + ci/before_install_jython.sh + if: matrix.jython + env: + JYTHON: ${{ matrix.jython }} + - name: Install dependencies + # for some reason installing from https://github.com/baztian/tox-gh-actions/archive/allow-env-override.tar.gz doesn't work + run: pip install coveralls tox git+https://github.com/baztian/tox-gh-actions.git@allow-env-override + - name: Test with tox for Jython only + if: matrix.jython + run: tox -e "${{ matrix.toxenv }}" + - name: Test with tox for non Jython only + if: ${{ ! matrix.jython }} + run: tox + - name: Coveralls + uses: baztian/coveralls-python-action@new-merged-changes + with: + parallel: true + flag-name: ${{ matrix.plattform }}-${{ matrix.python-version }} + coverage-version: 4.5.4 + + coveralls_finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: baztian/coveralls-python-action@new-merged-changes + with: + parallel-finished: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 30edcec..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -os: linux -dist: focal -language: python - -deploy: - provider: pypi - username: cheffe - password: - secure: ZQsqnd4Ux3erP0xfLJefJ/90wcJX/L2SfYOZFPbAIwJaX3n9iXf7jOGaT5FzJxLH+c0RJ1varqX0WZo1v0YKRz05IiSCLfZIT3Ia/Cy4nOLLL4a6CFUqzTlO7V1xyKMtQKimWGF5AYTAWvLTPu7cdDeg1YPENrZBYZPvJ/yRiJ4= - distributions: "sdist bdist_wheel" - on: - tags: true - repo: baztian/jaydebeapi - -cache: - pip: true - directories: - - $TRAVIS_BUILD_DIR/.tox/shared/.m2 - - $HOME/jython - -python: - - '2.7' - - '3.5' - - '3.6' - -env: - -jobs: - include: - - python: 3.6 - env: JYTHON=org.python:jython-installer:2.7.2 TOXENV="jython-driver-{hsqldb,mock}" - -before_install: - - ci/before_install.sh - - export PATH="$HOME/bin:$PATH" - -install: - - pip install coveralls - - pip install tox-travis - -script: tox - -after_success: - - coveralls diff --git a/README.rst b/README.rst index 56d0eb7..6aeb075 100644 --- a/README.rst +++ b/README.rst @@ -2,13 +2,14 @@ JayDeBeApi - bridge from JDBC database drivers to Python DB-API ================================================================= -.. image:: https://img.shields.io/travis/baztian/jaydebeapi/master.svg - :target: https://travis-ci.org/baztian/jaydebeapi +.. image:: https://github.com/baztian/jaydebeapi/workflows/tests/badge.svg + :target: https://github.com/baztian/jaydebeapi/actions?query=workflow%3Atests + :alt: test status .. image:: https://img.shields.io/coveralls/baztian/jaydebeapi/master.svg :target: https://coveralls.io/r/baztian/jaydebeapi -.. image:: https://img.shields.io/badge/python-2.7,_3.5,_3.6-blue.svg +.. image:: https://img.shields.io/badge/python-2.7,_3.5,_3.6,_3.8-blue.svg :target: https://pypi.python.org/pypi/JayDeBeApi/ .. image:: https://img.shields.io/badge/jython-2.7.2-blue.svg diff --git a/README_development.rst b/README_development.rst index 466785c..10510ae 100644 --- a/README_development.rst +++ b/README_development.rst @@ -52,7 +52,7 @@ Build a new release $ git commit -m "my comment" $ git push -5. Wait for travis CI build to finish successfully. +5. Wait for GitHub Actions build to finish successfully. 6. Bump version :: diff --git a/ci/before_install.sh b/ci/before_install.sh deleted file mode 100755 index 1a99394..0000000 --- a/ci/before_install.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -e - -[ -n "$JYTHON" ] && "${TRAVIS_BUILD_DIR}/ci/before_install_jython.sh" || true diff --git a/ci/before_install_jython.sh b/ci/before_install_jython.sh index 5aa7f17..c60e61c 100755 --- a/ci/before_install_jython.sh +++ b/ci/before_install_jython.sh @@ -3,9 +3,8 @@ set -e INST_DIR=$HOME/jython/jython-${JYTHON##*:} if [ ! -d "$INST_DIR" ]; then - JYTHON_JAR=$(${TRAVIS_BUILD_DIR}/ci/mvnget.sh "$JYTHON") + JYTHON_JAR=$(${PWD}/ci/mvnget.sh "$JYTHON") java -jar ${JYTHON_JAR} -s -d "$INST_DIR" fi -pip install --upgrade virtualenv==15.1.0 tox==3.9.0 coverage==4.5.4 -mkdir -p $HOME/bin -ln -s "$INST_DIR"/bin/jython $HOME/bin/ +pip install --upgrade virtualenv==15.1.0 tox==3.9.0 +sudo ln -s "$INST_DIR"/bin/jython /usr/local/bin/ diff --git a/tox.ini b/tox.ini index ad29f3f..ccf38f2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,15 @@ [tox] -envlist = py{27,3}-driver-{hsqldb,mock,sqliteXerial}-newjpype,py{27,3}-driver-{hsqldb,mock}-oldjpype,py27-driver-sqlitePy,jython-driver-{hsqldb,mock} +envlist = py{27,35,36,38}-driver-{hsqldb,mock,sqliteXerial}-newjpype, + py{27,35,36,38}-driver-{hsqldb,mock}-oldjpype, + py27-driver-sqlitePy, + jython-driver-{hsqldb,mock} -[travis] +[gh-actions] python = 2.7: py27-driver-{hsqldb,mock,sqliteXerial,sqlitePy}-newjpype, py27-driver-{hsqldb,mock}-oldjpype 3.5: py35-driver-{hsqldb,mock,sqliteXerial}-newjpype 3.6: py36-driver-{hsqldb,mock,sqliteXerial}-newjpype, py36-driver-{hsqldb,mock}-oldjpype + 3.8: py38-driver-{hsqldb,mock,sqliteXerial}-newjpype, py38-driver-{hsqldb,mock}-oldjpype [testenv] # usedevelop required to enable coveralls source code view. @@ -21,6 +25,7 @@ deps = oldjpype: JPype1==0.6.3 py35-newjpype: JPype1==0.7.5 py36-newjpype: JPype1==0.7.5 + py38-newjpype: JPype1==0.7.5 py27-newjpype: JPype1==0.7.1 jip==0.9.15 coverage==4.5.4