Skip to content

Commit

Permalink
fix(ci): migration from Travis CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Jan 22, 2021
1 parent 2deea28 commit d74edcd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 35 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,58 @@
name: Release
on: [push, pull_request]

jobs:
test:
name: Test Job
# Support [skip ci] out of box with github actions Workaround
# Only works for push https://github.com/actions/runner/issues/774
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '[skip ci]') == false)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Install dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -r requirements.txt
pip install --upgrade -e .
- name: Validate & Coverage Report
run: |
"./scripts/pep8check.sh"
"./scripts/coverage.sh"
release:
name: Release Job
runs-on: ubuntu-latest
needs:
- test
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -r requirements.txt
pip install --upgrade -e .
- name: Setup NodeJS LTS
uses: actions/setup-node@v2
- name: Install dependencies
run: |
npm prune && npm i
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: npx semantic-release
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# python-sdk

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Build Status](https://travis-ci.com/hexonet/python-sdk.svg?branch=master)](https://travis-ci.com/hexonet/python-sdk)
[![Build Status](https://github.com/hexonet/python-sdk/workflows/Release/badge.svg?branch=master)](https://github.com/hexonet/python-sdk/workflows/Release/badge.svg?branch=master)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hexonet.apiconnector.svg)](https://www.python.org/)
[![PyPI](https://img.shields.io/pypi/v/hexonet.apiconnector.svg)](https://pypi.org/project/hexonet.apiconnector/)
[![Documentation Status](https://readthedocs.org/projects/hexonet-python-sdk/badge/?version=latest)](https://hexonet-python-sdk.readthedocs.io/en/latest/?badge=latest)
Expand Down

0 comments on commit d74edcd

Please sign in to comment.