Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Github Actions for tests and releases #444

Merged
merged 22 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 0 additions & 114 deletions .appveyor.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/actions/scripts/manylinux_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

yum install -y java-1.7.0-openjdk-devel

for target in $(ls /opt/python/); do
python=/opt/python/$target/bin/python
$python -m pip install -U setuptools cython
$python setup.py bdist_wheel
done

for whl in dist/*.whl; do
auditwheel repair $whl
done

rm dist/*-linux_*.whl
mv wheelhouse/*.whl dist/
4 changes: 4 additions & 0 deletions .github/actions/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

pip install .[dev]
pytest
138 changes: 138 additions & 0 deletions .github/workflows/create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
on: create
name: Continuous Delivery
jobs:
PrepareRelease:
name: prepare-release
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
python:
- '2.7'
- '3.6'
- '3.7'
- '3.8'
java:
- '12'
os:
- 'windows-latest'
- 'macOs-latest'
architecture:
- 'x64'
- 'x86'

# exclude problematic combinations
exclude:
- os: windows-latest
python: '2.7'
- os: macOs-latest
architecture: 'x86'

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}

- name: Setup java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
architecture: ${{ matrix.architecture }}

- name: build sdist
if: matrix.os == 'windows-latest' && matrix.python == '3.8' && matrix.architecture == 'x64'
run: |
pip install -U setuptools
python setup.py sdist

- name: build-wheel-windows
if: matrix.os == 'windows-latest'
run: |
"%VS140COMNTOOLS%../../VC/vcvarsall.bat"
echo "$INCLUDE"
set INCLUDE "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"
pip install --timeout=120 -U setuptools wheel cython
python setup.py bdist_wheel

- name: build wheel
if: matrix.os != 'windows-latest'
run: |
pip install -U --timeout=120 -U setuptools wheel cython
python setup.py bdist_wheel

- name: upload wheel
uses: actions/upload-artifact@master
with:
name: dist
path: dist

PrepareManylinux:
name: prepare-manylinux
if: startsWith(github.ref, 'refs/tags/')
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@master

- uses: docker://quay.io/pypa/manylinux2010_x86_64
with:
entrypoint: .github/actions/scripts/manylinux_entrypoint.sh

- name: upload wheel
uses: actions/upload-artifact@master
with:
name: dist
path: dist

Release:
name: release
needs:
- PrepareRelease
- PrepareManylinux
runs-on: 'ubuntu-latest'
steps:
- uses: actions/download-artifact@master
with:
name: dist
path: dist

- name: Upload Test Release Asset
id: create_test_release
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-test')
uses: softprops/action-gh-release@78c309e
with:
prerelease: true
files: |
dist/*.whl
dist/*.zip
dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Asset
id: upload-release-asset
if: startsWith(github.ref, 'refs/tags/') && ! endsWith(github.ref, '-test')
uses: softprops/action-gh-release@78c309e
with:
files: |
dist/*.whl
dist/*.zip
dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-test')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN_TEST }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package
if: startsWith(github.ref, 'refs/tags/') && ! endsWith(github.ref, '-test')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
98 changes: 98 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
on: push
name: Continuous Integration
jobs:
Tests:
name: base
strategy:
matrix:
python:
- '2.7'
- '3.6'
- '3.7'
- '3.8'
java:
- '8'
# - '9' # commented out just for faster CI
- '10'
# - '11' # commented out just for faster CI
- '12'
os:
- 'ubuntu-latest'
- 'windows-latest'
- 'macOs-latest'
architecture:
- 'x64'
- 'x86'

# exclude problematic combinations
exclude:
- os: windows-latest
python: '2.7'
- os: macOs-latest
architecture: 'x86'

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master

- name: Setup python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}

- name: Setup java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
architecture: ${{ matrix.architecture }}

- name: install-windows
if: matrix.os == 'windows-latest'
run: |
"%VS140COMNTOOLS%../../VC/vcvarsall.bat"
echo "$INCLUDE"
set INCLUDE "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"
pip install --timeout=120 -U setuptools cython
pip install --timeout=120 -vv .[dev,ci]

- name: install
if: matrix.os == 'ubuntu-latest'
run: |
pip install --timeout=120 -U setuptools cython
pip install --timeout=120 .[dev,ci]

- name: install-osx
if: matrix.os == 'macOs-latest'
run: |
brew install ant
pip install --timeout=120 --user -U setuptools cython
pip install --timeout=120 --user .[dev,ci]

- name: test-windows
if: matrix.os == 'windows-latest'
run: |
$env:PATH +=";$env:JAVA_HOME\jre\bin\server\;$env:JAVA_HOME\jre\bin\client\;$env:JAVA_HOME\bin\server\"
$env:CLASSPATH ="../build/test-classes;../build/classes"

ant all
cd tests
nosetests -v

- name: test
if: matrix.os == 'ubuntu-latest'
run: |
ant all
cd tests
CLASSPATH=../build/test-classes:../build/classes nosetests -v

- name: test
if: matrix.os == 'macOs-latest'
run: |
ant all
cd tests
CLASSPATH=../build/test-classes:../build/classes python -m nose -v

# - name: coveralls
# run: python -m coveralls
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Loading