-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated CI to run through github actions
- Loading branch information
Showing
3 changed files
with
69 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters