Skip to content

Commit d74edcd

Browse files
fix(ci): migration from Travis CI to github actions
1 parent 2deea28 commit d74edcd

File tree

3 files changed

+59
-35
lines changed

3 files changed

+59
-35
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Test Job
7+
# Support [skip ci] out of box with github actions Workaround
8+
# Only works for push https://github.com/actions/runner/issues/774
9+
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(toJson(github.event.commits), '[skip ci]') == false)
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
17+
- name: Install dependencies
18+
run: |
19+
pip install --upgrade pip
20+
pip -V
21+
pip install --upgrade -r requirements.txt
22+
pip install --upgrade -e .
23+
- name: Validate & Coverage Report
24+
run: |
25+
"./scripts/pep8check.sh"
26+
"./scripts/coverage.sh"
27+
release:
28+
name: Release Job
29+
runs-on: ubuntu-latest
30+
needs:
31+
- test
32+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
38+
persist-credentials: false
39+
- uses: actions/setup-python@v2
40+
with:
41+
python-version: "3.x"
42+
- name: Install dependencies
43+
run: |
44+
pip install --upgrade pip
45+
pip -V
46+
pip install --upgrade -r requirements.txt
47+
pip install --upgrade -e .
48+
- name: Setup NodeJS LTS
49+
uses: actions/setup-node@v2
50+
- name: Install dependencies
51+
run: |
52+
npm prune && npm i
53+
- name: Release
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
56+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
57+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
58+
run: npx semantic-release

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# python-sdk
22

33
[![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)
4-
[![Build Status](https://travis-ci.com/hexonet/python-sdk.svg?branch=master)](https://travis-ci.com/hexonet/python-sdk)
4+
[![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)
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hexonet.apiconnector.svg)](https://www.python.org/)
66
[![PyPI](https://img.shields.io/pypi/v/hexonet.apiconnector.svg)](https://pypi.org/project/hexonet.apiconnector/)
77
[![Documentation Status](https://readthedocs.org/projects/hexonet-python-sdk/badge/?version=latest)](https://hexonet-python-sdk.readthedocs.io/en/latest/?badge=latest)

0 commit comments

Comments
 (0)