Skip to content

Initial version

Initial version #9

Workflow file for this run

---
name: main
on:
pull_request:
release:
types: [published]
jobs:
validate-hassfest:
name: Validate with hassfest
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Check the code with hassfest
uses: home-assistant/actions/hassfest@master
validate-hacs:
name: Validate with hacs
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Display GH event
run: cat "${{ github.event_path }}"
- name: Check the code with hacs
uses: "hacs/action@main"
tests:
name: Tests
strategy:
matrix:
include:
- os: ubuntu-latest
python: '3.10'
toxenv: py310
- os: ubuntu-latest
python: '3.11'
toxenv: py311
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the code
uses: actions/checkout@v3
with:
# Disable shallow clone for Sonar scanner, as it needs access to the
# history
fetch-depth: 0
- name: Set Python up
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install testing tools
run: >-
python -m pip install --upgrade setuptools_scm pip tox virtualenv coverage
- name: Run the tests
run: tox -e ${{ matrix.toxenv }}
- name: Generage Coverage XML report
run: coverage xml
- name: Determine package version
id: package-version
run: |
package_version=`python -m setuptools_scm`
echo "VALUE=$package_version" >> $GITHUB_OUTPUT
- name: SonarCloud scanning
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
# yamllint disable rule:line-length
args: >-
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectVersion=${{ steps.package-version.outputs.VALUE }}
# yamllint enable rule:line-length