Skip to content

Commit

Permalink
Move from Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
y.kikvadze committed Feb 2, 2023
1 parent dc4af27 commit 9a4eb74
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 27 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/package_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

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
pip install coveralls
- name: Run flake8
run: |
python -m flake8 app_properties/
- name: Run black
run: |
python -m black --line-length 79 --check app_properties/
- name: Run mypy
run: |
python -m mypy app_properties/
- name: Run bandit
run: |
python -m bandit app_properties/ -r
- name: Run tests
run: |
python -m coverage run --source=app_properties -m pytest
python -m coverage lcov --fail-under=80
- name: Send results to coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-python-${{ matrix.python-version }}
parallel: true
path-to-lcov: ./coverage.lcov

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Finish coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
29 changes: 29 additions & 0 deletions .github/workflows/package_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/conjector)](https://pypi.org/project/conjector/)
[![PyPI - Package Version](https://img.shields.io/pypi/v/conjector)](https://pypi.org/project/conjector/)
[![PyPI - License](https://img.shields.io/pypi/l/conjector)](https://pypi.org/project/conjector/)
[![Build Status](https://app.travis-ci.com/yar-kik/conjector.svg?branch=master)](https://app.travis-ci.com/yar-kik/conjector)
[![Build](https://github.com/yar-kik/conjector/actions/workflows/package_build.yml/badge.svg?branch=master)](https://github.com/yar-kik/conjector/actions/workflows/package_build.yml)
[![Coverage Status](https://coveralls.io/repos/github/yar-kik/conjector/badge.svg?branch=master)](https://coveralls.io/github/yar-kik/conjector?branch=master)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
Expand Down

0 comments on commit 9a4eb74

Please sign in to comment.