Skip to content

Commit 29cf3cb

Browse files
authored
Add a workflow to build and test using GitHub Actions
2 parents 3e161ab + e397e5e commit 29cf3cb

6 files changed

Lines changed: 44 additions & 6 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: "Build and Test"
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Install poetry
24+
run: pipx install poetry
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: "poetry"
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install flake8
33+
poetry install
34+
- name: Lint with flake8
35+
run: |
36+
# stop the build if there are Python syntax errors or undefined names
37+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
- name: Test with unittest
41+
run: poetry run python -m unittest discover test

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EvlDaemon [![Build Status](https://travis-ci.org/Tokenize/evl-daemon-python.png)](https://travis-ci.org/Tokenize/evl-daemon-python)
1+
# EvlDaemon ![Build and Test](https://github.com/tokenize/evl-daemon-python/actions/workflows/build-and-test.yml/badge.svg) ![CodeQL](https://github.com/tokenize/evl-daemon-python/actions/workflows/codeql-analysis.yml/badge.svg)
22

33
A cross-platform Python API and daemon for the **Envisalink TPI (DSC)** module.
44

evl/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def report(self) -> dict:
182182
"armed_state": self.armed_state,
183183
"connection": self.connection,
184184
"last_event": last_event,
185-
"listeners": [str(l) for l in self.listeners],
185+
"listeners": [str(listener) for listener in self.listeners],
186186
"notifiers": [str(n) for _, n in self.notifiers.items()],
187187
"partitions": util.describe_dict(EventManager.partitions),
188188
"storage": [str(s) for _, s in self.storage.items()],

evl/notifiers/consolenotifier.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from time import localtime, strftime
2-
31
from evl.command import Priority
42
from evl.event import Event
53

evl/notifiers/smsnotifier.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
from time import localtime, strftime
32

43
from twilio.base.exceptions import TwilioException
54
from twilio.rest import Client

0 commit comments

Comments
 (0)