Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Aug 15, 2023
1 parent 4156023 commit 97cf699
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Issue
about: Create a report to help us improve

---

<!-- Before you open a new issue, search through the existing issues to see if others have had the same problem.
Issues not containing the minimum requirements will be closed:
- Issues without a description (using the header is not good enough) will be closed.
- Issues without debug logging will be closed.
- Issues without configuration will be closed
-->

## Version of the custom_component
<!-- If you are not using the newest version, download and try that before opening an issue
If you are unsure about the version check the const.py file.
-->

## Configuration

```yaml

Add your logs here.

```

## Describe the bug
A clear and concise description of what the bug is.


## Debug log

<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ -->

```text
Add your logs here.
```
22 changes: 22 additions & 0 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Cron actions

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v3.5.2"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
17 changes: 17 additions & 0 deletions .github/workflows/hacs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: HACS Action

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
hacs:
name: HACS Action
runs-on: "ubuntu-latest"
steps:
- name: HACS Action
uses: "hacs/action@main"
with:
category: "integration"
55 changes: 55 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Pull actions

on:
pull_request:

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v3"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"

style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4.6.0"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .

tests:
runs-on: "ubuntu-latest"
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v3"
- name: Setup Python
uses: "actions/setup-python@v4.6.0"
with:
python-version: "3.8"
- name: Install requirements
run: python3 -m pip install -r requirements_test.txt
- name: Run tests
run: |
pytest \
-qq \
--timeout=9 \
--durations=10 \
-n auto \
--cov custom_components.integration_blueprint \
-o console_output_style=count \
-p no:sugar \
tests
34 changes: 34 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Push actions

on:
push:
branches:
- master
- dev

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v3"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"

style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4.6.0"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .

0 comments on commit 97cf699

Please sign in to comment.