Skip to content

Commit

Permalink
tools: add GitHub actions to provide CI for linting, testing and code…
Browse files Browse the repository at this point in the history
… coverage (#15)

#15
  • Loading branch information
palazzem authored Sep 1, 2023
2 parents 99bddf4 + 6b64017 commit cb88cd1
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Linting'

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
econnect:
runs-on: ubuntu-20.04

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Upgrade pip and install required tools
run: |
pip install --upgrade pip
pip install tox
- name: Lint codebase
run: tox -e lint
41 changes: 41 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Testing'

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
contents: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
econnect:
runs-on: ubuntu-20.04
env:
TOX_SKIP_ENV: lint

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Upgrade pip and install required tools
run: |
pip install --upgrade pip
pip install tox
- name: Test with tox environments
run: tox

- name: Update Coveralls report
uses: coverallsapp/github-action@v2
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Home Assistant e-Connect Integration (Elmo)

[![Linting](https://github.com/palazzem/ha-econnect-alarm/actions/workflows/linting.yaml/badge.svg)](https://github.com/palazzem/ha-econnect-alarm/actions/workflows/linting.yaml)
[![Testing](https://github.com/palazzem/ha-econnect-alarm/actions/workflows/testing.yaml/badge.svg)](https://github.com/palazzem/ha-econnect-alarm/actions/workflows/testing.yaml)
[![Coverage Status](https://coveralls.io/repos/github/palazzem/ha-econnect-alarm/badge.svg?branch=main)](https://coveralls.io/github/palazzem/ha-econnect-alarm?branch=main)

This project is a [Home Assistant](https://www.home-assistant.io/) integration for your Elmo Alarm connected to
[e-Connect cloud](https://e-connect.elmospa.com/it/).

Expand Down

0 comments on commit cb88cd1

Please sign in to comment.