Fix pre-commit and update CI (#875)
This commit is contained in:
8
.github/workflows/stale.yml
vendored
8
.github/workflows/stale.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues)
|
# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues)
|
||||||
name: Close stale PRs
|
name: Close stale PRs
|
||||||
on:
|
on: # yamllint disable-line rule:truthy
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 4 * * *
|
- cron: 0 4 * * *
|
||||||
|
|
||||||
@@ -19,6 +19,6 @@ jobs:
|
|||||||
remove-stale-when-updated: false
|
remove-stale-when-updated: false
|
||||||
stale-pr-label: stale
|
stale-pr-label: stale
|
||||||
stale-pr-message: >
|
stale-pr-message: >
|
||||||
This PR has been automatically marked as stale because it has not had
|
This PR has been automatically marked as stale because it has not
|
||||||
recent activity. It will be closed automatically if no further progress
|
had recent activity. It will be closed automatically if no further
|
||||||
is made.
|
progress is made.
|
||||||
|
|||||||
17
.github/workflows/validation.yml
vendored
17
.github/workflows/validation.yml
vendored
@@ -1,25 +1,30 @@
|
|||||||
---
|
---
|
||||||
name: Validate definitions
|
name: Validate definitions
|
||||||
|
|
||||||
on:
|
|
||||||
|
on: # yamllint disable-line rule:truthy
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pip install -r requirements.txt
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Lint YAML files
|
- name: Lint YAML files
|
||||||
run: yamllint --format parsable --strict -c=tests/yamllint.yaml device-types/ module-types/
|
run: |
|
||||||
|
yamllint --format github --strict \
|
||||||
|
device-types/ module-types/
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pytest --tb=short -v
|
run: pytest --tb=short -v
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.4.0
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
name: Check YAML files
|
name: Check YAML files
|
||||||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
|
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
|
||||||
rev: 0.1.0
|
rev: 0.2.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamlfmt
|
- id: yamlfmt
|
||||||
args: [--mapping, '2', --sequence, '4', --offset, '2']
|
args: [--mapping, '2', --sequence, '4', --offset, '2']
|
||||||
- repo: https://github.com/adrienverge/yamllint.git
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
rev: v1.26.0
|
rev: v1.27.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
name: Lint YAML files
|
name: Lint YAML files
|
||||||
args: [--format, parsable, --strict, -c=tests/yamllint.yaml]
|
args: [--format, parsable, --strict]
|
||||||
|
|||||||
@@ -27,6 +27,3 @@ rules:
|
|||||||
octal-values: disable
|
octal-values: disable
|
||||||
quoted-strings: disable
|
quoted-strings: disable
|
||||||
trailing-spaces: enable
|
trailing-spaces: enable
|
||||||
truthy:
|
|
||||||
ignore: |
|
|
||||||
.github/workflows/validation.yml
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
jsonschema==3.2.0
|
jsonschema==3.2.0
|
||||||
pytest==5.3.2
|
pytest==5.3.2
|
||||||
PyYAML==5.4
|
PyYAML==5.4
|
||||||
yamllint==1.26.0
|
yamllint==1.27.1
|
||||||
|
|||||||
Reference in New Issue
Block a user