Merge pull request #155 from baztian/github-actions

Migrate to github actions
master
baztian 2020-06-30 21:47:55 +02:00 committed by GitHub
commit 936817b9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 128 additions and 58 deletions

31
.github/workflows/publish.yml vendored 100644
View File

@ -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/*

82
.github/workflows/tests.yml vendored 100644
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 ::

View File

@ -1,4 +0,0 @@
#!/bin/sh
set -e
[ -n "$JYTHON" ] && "${TRAVIS_BUILD_DIR}/ci/before_install_jython.sh" || true

View File

@ -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/

View File

@ -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