Skip to content

Commit 4ad396f

Browse files
create actions test workflow
1 parent b0e1390 commit 4ad396f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: "3.12"
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install paho-mqtt requests coverage coveralls
22+
- name: Print versions
23+
run: |
24+
python -c 'import paho.mqtt; print("Paho MQTT " + paho.mqtt.__version__)'
25+
python -c 'import requests; print("Requests " + requests.__version__)'
26+
- name: Run tests
27+
run: python -m coverage run -m unittest discover -v
28+
- name: Print coverage report
29+
run: python -m coverage report
30+
- name: Upload coverage
31+
run: coveralls
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)