-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (72 loc) · 2.19 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
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: Check the code with hacs
uses: "hacs/action@main"
with:
category: integration
tests:
name: Tests
strategy:
matrix:
include:
- os: ubuntu-latest
python: '3.12'
toxenv: py
- os: ubuntu-latest
python: '3.13'
toxenv: py
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