From 607e9b42ac80a7bb4865dffce8346f910981f45b Mon Sep 17 00:00:00 2001 From: sprockets Date: Tue, 17 Mar 2020 15:37:36 +0530 Subject: [PATCH] Removed travis.yml and added testing.yaml & deploy.yaml --- .github/workflows/deploy.yaml | 20 +++++++++++ .github/workflows/testing.yaml | 61 ++++++++++++++++++++++++++++++++++ .travis.yml | 25 -------------- 3 files changed, 81 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/testing.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..f75d195 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,20 @@ +name: Deployment +on: + push: + branches-ignore: ["*"] + tags: ["*"] +jobs: + deploy: + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'sprockets/sprockets.mixins.avro-publisher' + container: python:3.8-alpine + steps: + - name: Checkout repository + uses: actions/checkout@v1 + - name: Build package + run: python3 setup.py sdist + - name: Publish package + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml new file mode 100644 index 0000000..479b801 --- /dev/null +++ b/.github/workflows/testing.yaml @@ -0,0 +1,61 @@ +name: Testing +on: + push: + branches: ["*"] + paths-ignore: + - 'docs/**' + - 'setup.*' + - '*.md' + - '*.rst' + tags-ignore: ["*"] +jobs: + test: + runs-on: ubuntu-latest + services: + rabbitmq: + image: rabbitmq:3.8 + options: >- + --health-cmd "/opt/rabbitmq/sbin/rabbitmqctl node_health_check" + --health-interval 10s + --health-timeout 10s + --health-retries 5 + ports: + - 5672:5672 + - 15672:15672 + env: + AMQP_EXCHANGE: amq.topic + AMQP_URL: amqp://guest:guest@rabbitmq:5672/%2f + RABBIMQ_URL: http://guest:guest@rabbitmq:15672 + strategy: + matrix: + python: [3.7, 3.8] + container: + image: python:${{ matrix.python }}-alpine + steps: + - name: Checkout repository + uses: actions/checkout@v1 + + - name: Install testing dependencies + run: pip3 install -r requires/testing.txt + + - name: Install library dependencies + run: python3 setup.py develop + + - name: Create build directory + run: mkdir -p build + + - name: Run flake8 tests + run: flake8 --output build/flake8.txt --tee + + - name: Run tests + run: coverage run + + - name: Generate reports + run: coverage xml && coverage report + + - name: Upload Coverage + uses: codecov/codecov-action@v1.0.2 + if: github.repository == 'sprockets/sprockets.mixins.avro-publisher' + with: + token: ${{secrets.CODECOV_TOKEN}} + file: build/coverage.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0813874..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: python -python: - - 2.7 - - pypy - - 3.4 - - 3.7 - - 3.8 -services: - - rabbitmq -install: - - pip install -r requires/testing.txt -e . -script: - - nosetests -after_success: - - codecov -deploy: - provider: pypi - user: sprockets - password: - secure: TPpdlEbbxfjcFXR7KizRNiwqZDdB8C8/y0zE/nbFvlds1ZfdqRwCZJlvgsVwhUfiMrUfKiZ3sg1kSI6wN0Li8Z4DVe8RPyhnOXjml6DDao4iZ569LYEfqMdfWrp6NcN/+sMOpGlq5XuQMcdsy3P9uP8WGOUzRwjuQ0ny+2BN8yxD3TxY+TqgYo3FaCYwR0bp5u8l1pmX9gIbD8DhcbbC7EyO+/t8IZj4x5TxIQamIvhWyd8LIFpvR1FcCKRPbqu2x2fPZG4t6YwBHbcmLf8VnZx5xFGvOKEP9HaN4YkWtSIHQ/RhCuFslSPg4peHK3xgurDKMsXdvxnsV2AgSQBEQEaWt6ewACbM4nyW09K++LKK0F19U6keSzYgLZZK+Twsn02xhNpQf58k5kuAB0pJNm+EFxymUcJjR5g9gnVE2ln/Y3MkU1YhXRJGvo0hwdcytkDaPitIASuPC9buy/UQ8smzYPfA60PAF9Dl0/gq8lIWteq3u6PJQT+qtSobWwhR/nFYqTWDMk1sZu4sHVe1IPhSnJonlWccPe/AcS6qG8QNUt5n4fC1l5rerfsiplo+aSLH8gb6p5eiueBAXGwH/akZa6nb9hs1gFFZicHlCzMXlvA845qiLBHbj1ABNJri8jnRvtNxNcYdqBu73lkhExIHlsIG8sgRw93bN1ys73A= - on: - python: 3.4 - distributions: sdist bdist_wheel - tags: true - all_branches: true