Skip to content

Commit

Permalink
Circleci (#116)
Browse files Browse the repository at this point in the history
* Added circleci config. Updated travis cfg
  • Loading branch information
pkittenis authored Oct 3, 2020
1 parent 75f8475 commit a0196a8
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 44 deletions.
145 changes: 145 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
version: 2.1

orbs:
python: circleci/[email protected]

jobs:
python_test:
parameters:
python_ver:
type: string
default: "3.6"
docker:
- image: circleci/python:<< parameters.python_ver >>
steps:
- checkout
- python/load-cache:
dependency-file: requirements_dev.txt
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
- run:
name: Deps
command: |
sudo apt-get install cmake openssh-server
pip install -r requirements_dev.txt
- python/save-cache:
dependency-file: requirements_dev.txt
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
- run:
command: |
python setup.py build_ext --inplace
eval "$(ssh-agent -s)"
name: Build
- run:
command: |
ls -lhtr ssh2/
pwd
pytest tests
flake8 ssh2
python setup.py sdist
cd dist; pip install *; python -c 'from ssh2.session import Session; Session()'; cd ..
cd doc
make html
cd ..
name: Test

osx:
parameters:
xcode_ver:
type: string
default: "11.6.0"
macos:
xcode: << parameters.xcode_ver >>
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
SYSTEM_LIBSSH2: 1
steps:
- checkout
- run:
name: deps
command: |
brew install cmake git-lfs python libssh2
pip3 install twine
which twine
- run:
name: Build Wheel
command: |
./ci/osx-wheel.sh
- store_artifacts:
path: wheels
- run:
name: Upload Wheel
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/*
manylinux:
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- python/load-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Git LFS
command: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
git lfs pull
- run:
name: Deps
command: |
sudo apt-get install python-pip
pip install -U pip
pip install twine
which twine
- python/save-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Build Wheels
command: |
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin;
fi
./ci/travis/build-manylinux.sh
- run:
name: sdist
command: python setup.py sdist
- run:
name: Upload Wheels
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*
workflows:
version: 2.1
main:
jobs:
- python_test:
matrix:
parameters:
python_ver:
- "3.6"
- "3.7"
- "3.8"
filters:
tags:
ignore: /.*/
- manylinux:
context: Docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- osx:
matrix:
parameters:
xcode_ver:
- "11.6.0"
- "11.1.0"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
81 changes: 38 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ notifications:
email: false
python:
- 2.7
- 3.6
- 3.7
- 3.8
install:
- pip install flake8 jinja2 sphinx sphinx_rtd_theme
- python setup.py build_ext --inplace
Expand Down Expand Up @@ -44,46 +41,44 @@ jobs:
include:

- stage: test
if: type = push OR \
(type = pull_request AND fork = true)

- &osx-wheels
stage: build packages
if: tag IS present
os: osx
osx_image: xcode11.6
env:
- SYSTEM_LIBSSH2: 1
before_install:
- brew install libssh2
- pip3 install twine
- which twine
install: skip
script:
- ./ci/osx-wheel.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl;
fi
language: generic
python: skip
# - &osx-wheels
# stage: build packages
# if: tag IS present
# os: osx
# osx_image: xcode11.6
# env:
# - SYSTEM_LIBSSH2: 1
# before_install:
# - brew install libssh2
# - pip3 install twine
# - which twine
# install: skip
# script:
# - ./ci/osx-wheel.sh
# after_success:
# - if [[ ! -z "$TRAVIS_TAG" ]]; then
# twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl;
# fi
# language: generic
# python: skip

- <<: *osx-wheels
osx_image: xcode11.3
# - <<: *osx-wheels
# osx_image: xcode11.3

- stage: build packages
if: tag IS present
os: linux
python: 3.6
env:
- WHEELS=1
install:
- pip install twine
script:
- python setup.py sdist
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
- ./ci/travis/build-manylinux.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl dist/*;
fi
# - stage: build packages
# if: tag IS present
# os: linux
# python: 3.6
# env:
# - WHEELS=1
# install:
# - pip install twine
# script:
# - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
# - ./ci/travis/build-manylinux.sh
# - python setup.py sdist
# after_success:
# - if [[ ! -z "$TRAVIS_TAG" ]]; then
# twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl dist/*;
# fi
2 changes: 1 addition & 1 deletion ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

docker_tag="parallelssh/ssh2-manylinux"

rm -rf build dist ssh2/libssh2.*
rm -rf build ssh2/libssh2.*
python ci/appveyor/fix_version.py .

docker pull $docker_tag || echo
Expand Down

0 comments on commit a0196a8

Please sign in to comment.