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 diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml new file mode 100644 index 0000000..2b9e1ed --- /dev/null +++ b/.github/workflows/testing.yaml @@ -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 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/).