forked from sebirdman/hass_traeger
-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (74 loc) · 2.59 KB
/
validate.yml
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
77
78
79
80
81
name: "Validate"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches:
- "master"
- "dev"
pull_request:
branches:
- "master"
- "dev"
jobs:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: "Hassfest Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"
- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"
hacs: # https://github.com/hacs/action
name: "HACS Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"
- name: "Run HACS validation"
uses: "hacs/action@main"
with:
category: "integration"
# Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands
# ignore: "brands"
autoyapf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.head_ref }}
- name: autoyapf
id: autoyapf
uses: mritunjaysharma394/autoyapf@v2
with:
args: --style google --recursive --in-place .
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Automated autoyapf fixes"
git push
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install pylint-fail-under
- name: Analysing the code with pylint
run: find . -name '*.py' -print -exec pylint --disable=E0401 {} \;
- name: Fails if pylint score is less than 10.0
run: |
for file in $(find -name '*.py')
do
pylint --disable=E0401 "$file" --fail-under=10.0;
done