8000 Use github actions instead of azure pipelines (#206) · akshat-ja/python-kasa@41bed35 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41bed35

Browse files
authored
Use github actions instead of azure pipelines (python-kasa#206)
* Use github actions instead of azure pipelines * add codecov badge
1 parent b3c8f97 commit 41bed35

File tree

3 files changed

+86
-120
lines changed

3 files changed

+86
-120
lines changed

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
workflow_dispatch: # to allow manual re-runs
9+
10+
11+
jobs:
12+
linting:
13+
name: "Perform linting checks"
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
python-version: ["3.9"]
19+
20+
steps:
21+
- uses: "actions/checkout@v2"
22+
- uses: "actions/setup-python@v2"
23+
with:
24+
python-version: "${{ matrix.python-version }}"
25+
- name: "Install dependencies"
26+
run: |
27+
python -m pip install --upgrade pip poetry
28+
- name: "Code formating (black)"
29+
run: |
30+
poetry run pre-commit run black --all-files
31+
- name: "Code formating (flake8)"
32+
run: |
33+
poetry run pre-commit run flake8 --all-files
34+
- name: "Order of imports (isort)"
35+
run: |
36+
poetry run pre-commit run isort --all-files
37+
- name: "Typing checks (mypy)"
38+
run: |
39+
poetry run pre-commit run mypy --all-files
40+
- name: "Run trailing-whitespace"
41+
run: |
42+
poetry run pre-commit run trailing-whitespace --all-files
43+
- name: "Run end-of-file-fixer"
44+
run: |
45+
poetry run pre-commit run end-of-file-fixer --all-files
46+
- name: "Run check-docstring-first"
47+
run: |
48+
poetry run pre-commit run check-docstring-first --all-files
49+
- name: "Run debug-statements"
50+
run: |
51+
poetry run pre-commit run debug-statements --all-files
52+
- name: "Run check-ast"
53+
run: |
54+
poetry run pre-commit run check-ast --all-files
55+
- name: "Potential security issues (bandit)"
56+
run: |
57+
poetry run pre-commit run bandit --all-files
58+
59+
60+
tests:
61+
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}"
62+
needs: linting
63+
runs-on: ${{ matrix.os }}
64+
65+
strategy:
66+
matrix:
67+
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
68+
os: [ubuntu-latest, macos-latest, windows-latest]
69+
70+
steps:
71+
- uses: "actions/checkout@v2"
72+
- uses: "actions/setup-python@v2"
73+
with:
74+
python-version: "${{ matrix.python-version }}"
75+
- name: "Install dependencies"
76+
run: |
77+
python -m pip install --upgrade pip poetry
78+
- name: "Run tests"
79+
run: |
80+
poetry run pytest --cov kasa --cov-report xml
81+
- name: "Upload coverage to Codecov"
82+
uses: "codecov/codecov-action@v1"
83+
with:
84+
fail_ci_if_error: true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# python-kasa
22

33
[![PyPI version](https://badge.fury.io/py/python-kasa.svg)](https://badge.fury.io/py/python-kasa)
4-
[![Build Status](https://dev.azure.com/python-kasa/python-kasa/_apis/build/status/python-kasa.python-kasa?branchName=master)](https://dev.azure.com/python-kasa/python-kasa/_build/latest?definitionId=2&branchName=master)
5-
[![Coverage Status](https://coveralls.io/repos/github/python-kasa/python-kasa/badge.svg?branch=master)](https://coveralls.io/github/python-kasa/python-kasa?branch=master)
4+
[![Build Status](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml/badge.svg)](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml)
5+
[![codecov](https://codecov.io/gh/python-kasa/python-kasa/branch/master/graph/badge.svg?token=5K7rtN5OmS)](https://codecov.io/gh/python-kasa/python-kasa)
66
[![Documentation Status](https://readthedocs.org/projects/python-kasa/badge/?version=latest)](https://python-kasa.readthedocs.io/en/latest/?badge=latest)
77

88
python-kasa is a Python library to control TPLink smart home devices (plugs, wall switches, power strips, and bulbs) using asyncio.

azure-pipelines.yml

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

0 commit comments

Comments
 (0)
0