Skip to content

Commit

Permalink
Fix ci (#60)
Browse files Browse the repository at this point in the history
Updated CI to run through github actions
  • Loading branch information
lpouvreau committed Aug 4, 2021
1 parent 0839f1d commit a5b7c7d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 41 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and deploy python package

# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
# on.push.tags: '*'
# means the build will by triggered on any push done to any tags
on:
push:
tags:
- '*'

jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
strategy:
# Setting fail-fast to false, will let all concurrent jobs run if one of them fails, instead of cancelling all
# of them as soon as one fails.
fail-fast: false
matrix:
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests and coverage
run: |
pytest --cov=predicthq tests/
- name: Upload coverage data to coveralls.io
run: |
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

# slackNotification job is dependant on build-and-publish, it means that it will only be triggered if
# build-and-publish succeeds
slackNotification:
name: Slack Notification
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
coveralls>=1.8.2,<2.0
coveralls==2.2.0
coverage==5.5
pytest>=4.6.0,<5.0
pytest-cov>=2.8.1,<3.0
python-dateutil>=2.4.2,<3.0
Expand Down

0 comments on commit a5b7c7d

Please sign in to comment.