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

chore: merge test and deploy gh action workflows #154

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 0 additions & 51 deletions .github/workflows/release.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test and Deploy
on:
push:
branches: [ '*' ]
tags: [ '*' ]
pull_request:
branches: [ main ]
schedule:
# Run automatically at 8AM PST Monday-Friday
- cron: '0 15 * * 1-5'
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ]
steps:
- name: Checkout sendgrid-python-http-client
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build & Test
run: make install test-install test
deploy:
name: Deploy
if: success() && github.ref_type == 'tag'
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout sendgrid-python-http-client
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install wheel
python setup.py sdist bdist_wheel


- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

notify-on-failure:
name: Slack notify on failure
if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
needs: [ test, deploy ]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: failure
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
SLACK_TITLE: Action Failure - ${{ github.repository }}
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
50 changes: 0 additions & 50 deletions .github/workflows/tests.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. image:: https://github.com/sendgrid/sendgrid-python/raw/HEAD/twilio_sendgrid_logo.png
:target: https://www.sendgrid.com

|Test Status| |Twitter Follow| |Codecov branch| |Code Climate| |Python Versions| |PyPI Version| |GitHub contributors| |MIT licensed|
|Test and Deploy Badge| |Twitter Follow| |Codecov branch| |Code Climate| |Python Versions| |PyPI Version| |GitHub contributors| |MIT licensed|

**The default branch name for this repository has been changed to `main` as of 07/27/2020.**

Expand Down Expand Up @@ -157,8 +157,8 @@ License
.. _The MIT License (MIT): https://github.com/sendgrid/python-http-client/blob/HEAD/LICENSE
.. _this is an incredible opportunity to join our #DX team: https://sendgrid.com/careers/role/1421152/?gh_jid=1421152

.. |Test Status| image:: https://github.com/sendgrid/python-http-client/actions/workflows/tests.yml/badge.svg
:target: https://github.com/sendgrid/python-http-client/actions/workflows/tests.yaml
.. |Test and Deploy Badge| image:: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml/badge.svg
:target: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml
.. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow
:target: https://twitter.com/sendgrid
.. |Codecov branch| image:: https://img.shields.io/codecov/c/github/sendgrid/python-http-client/main.svg?style=flat-square&label=Codecov+Coverage
Expand Down