From 7b28a40fbe78991c80aef34f4d9800c3eef3fddd Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 1 Sep 2023 16:43:01 +0000 Subject: [PATCH 1/4] tools: add GitHub action -> linting --- .github/workflows/linting.yaml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/linting.yaml diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 0000000..4014ff0 --- /dev/null +++ b/.github/workflows/linting.yaml @@ -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 From 0ac0997ced9974c35cc94228cb73f762669bbc78 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 1 Sep 2023 16:43:07 +0000 Subject: [PATCH 2/4] tools: add GitHub action -> testing --- .github/workflows/testing.yaml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/testing.yaml diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml new file mode 100644 index 0000000..94c95ef --- /dev/null +++ b/.github/workflows/testing.yaml @@ -0,0 +1,38 @@ +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 From 4587320bc04f82380538840963e6da373402488f Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 1 Sep 2023 16:45:09 +0000 Subject: [PATCH 3/4] tools: add GitHub action -> test coverage --- .github/workflows/testing.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 94c95ef..2b9e1ed 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -36,3 +36,6 @@ jobs: - name: Test with tox environments run: tox + + - name: Update Coveralls report + uses: coverallsapp/github-action@v2 From 6b64017a64b0172cf59d4f5c71675a5a5aa200b1 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Fri, 1 Sep 2023 16:51:40 +0000 Subject: [PATCH 4/4] docs: add testing, linting and code coverage badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8d7b611..e419c49 100644 --- a/README.md +++ b/README.md @@ -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/).