Skip to content

Commit fb17142

Browse files
authored
ci: add CI tests (#14)
This test will run: * for pull requests * after pushing to master
1 parent 777cc06 commit fb17142

6 files changed

Lines changed: 47 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
workflow_dispatch:
87

98
jobs:
109
changes:

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI tests
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
types: [opened, synchronize]
8+
workflow_dispatch:
9+
10+
jobs:
11+
# This workflow contains a single job called "build"
12+
tests:
13+
name: Run tests for python ${{matrix.python}}
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python: [3.6, 3.7, 3.8, 3.9]
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
- name: Checkout
23+
uses: actions/[email protected]
24+
25+
- name: Prepare python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install setuptools wheel twine
34+
35+
- name: Install requirements
36+
run: pip install -r requirements.txt
37+
38+
- name: Run tests
39+
run: python -m unittest discover -s tests -t . -p \*.py

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
![CI tests](https://github.com/TionAPI/tion_python/workflows/CI%20tests/badge.svg?branch=master&event=push)
2+
13
You should pair Tion S3 device with your bluetooth host by two steps:
24
1. pressing for 5 second poer button at device
35
2. running ./pair.py device_mac_address while button blinks
46
before use this module!
57

6-
If you want to use MagicAir API please follow https://github.com/airens/tion
8+
If you want to use MagicAir API please follow https://github.com/airens/tion

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bluepy==1.3.0

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

tests/lite.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
_LOGGER.setLevel("DEBUG")
88
try:
99
mac = sys.argv[1]
10+
if mac == 'discover':
11+
_LOGGER.debug("%s", sys.argv)
12+
mac = 'dummy'
1013
except IndexError:
1114
mac = "dummy"
1215

0 commit comments

Comments
 (0)