From c16f3f32f10a18f5ea8d5c071db7edf043db2ab0 Mon Sep 17 00:00:00 2001 From: gritaro Date: Tue, 20 Feb 2024 14:23:25 +0700 Subject: [PATCH] Enhance github actions files --- .github/CODEOWNERS | 1 + .github/dependabot.yaml | 17 +++++++ .github/settings.yml | 92 ++++++++++++++++++++++++++++++++++++++ .github/workflows/pull.yml | 59 ++++++++++++++++++++++++ .github/workflows/push.yml | 63 ++++++++++++++++++++++++++ requirements.txt | 1 + requirements_test.txt | 1 + 7 files changed, 234 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yaml create mode 100644 .github/settings.yml create mode 100644 .github/workflows/pull.yml create mode 100644 .github/workflows/push.yml create mode 100644 requirements.txt create mode 100644 requirements_test.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..9560db6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @gritaro \ No newline at end of file diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..0cc3ab5 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: +- package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + +- package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..65cc767 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,92 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ + +repository: + # See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings. + + # The name of the repository. Changing this will rename the repository + name: gigachat + + # A short description of the repository that will show up on GitHub + description: This custom component for Home Assistant allows you to generate text responses using GigaChain LLM framework (like GigaChat or YandexGPT and ChatGPT). + + # A URL with more information about the repository + homepage: https://github.com/gritaro/gigachat + + # A comma-separated list of topics to set on the repository + topics: openai, gpt, homeassistant, voice-assistant, hacs-integration, chatgpt, yandexgpt, gigachat, gigachain, langchain + + # Either `true` to make the repository private, or `false` to make it public. + private: false + + # Either `true` to enable issues for this repository, `false` to disable them. + has_issues: true + + # Either `true` to enable projects for this repository, or `false` to disable them. + # If projects are disabled for the organization, passing `true` will cause an API error. + has_projects: false + + # Either `true` to enable the wiki for this repository, `false` to disable it. + has_wiki: false + + # Either `true` to enable downloads for this repository, `false` to disable them. + #has_downloads: false + + # Updates the default branch for this repository. + default_branch: main + + # Either `true` to allow squash-merging pull requests, or `false` to prevent + # squash-merging. + allow_squash_merge: true + use_squash_pr_title_as_default: true + + # Either `true` to allow merging pull requests with a merge commit, or `false` + # to prevent merging pull requests with merge commits. + allow_merge_commit: false + + # Either `true` to allow rebase-merging pull requests, or `false` to prevent + # rebase-merging. + allow_rebase_merge: true + + # Either `true` to enable automatic deletion of branches on merge, or `false` to disable + delete_branch_on_merge: true + + # Either `true` to enable automated security fixes, or `false` to disable + # automated security fixes. + #enable_automated_security_fixes: true + + # Either `true` to enable vulnerability alerts, or `false` to disable + # vulnerability alerts. + enable_vulnerability_alerts: true + +# Labels: define labels for Issues and Pull Requests +labels: +- name: "Feature Request" + color: "00ffbb" + +- name: "Bug" + color: "e30000" + +- name: "Wont Fix" + color: "ffffff" + +- name: "Enhancement" + color: "48ff00" + +- name: "Documentation" + color: "0077ff" + +- name: "User Assistance" + color: "0077ff" + +- name: "Stale" + color: "ffffff" + +- name: "Help needed" + color: "fbca04" + +- name: "dependencies" + color: "000000" + +- name: "github_actions" + color: "000000" + diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml new file mode 100644 index 0000000..dea39d3 --- /dev/null +++ b/.github/workflows/pull.yml @@ -0,0 +1,59 @@ +name: Pull actions + +on: + pull_request: + +env: + PYTHON_VERSION: "3.10" + +jobs: + validate: + runs-on: "ubuntu-latest" + name: Validate + steps: + - uses: "actions/checkout@v3.5.3" + + - name: HACS validation + uses: "hacs/action@main" + with: + category: "integration" + + - name: Hassfest validation + uses: "home-assistant/actions/hassfest@master" + + style: + runs-on: "ubuntu-latest" + name: Check style formatting + steps: + - uses: "actions/checkout@v3.5.3" + - uses: "actions/setup-python@v4.7.0" + with: + python-version: ${{ env.PYTHON_VERSION }} + - 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.5.3" +# - name: Setup Python +# uses: "actions/setup-python@v4.7.0" +# with: +# python-version: ${{ env.PYTHON_VERSION }} +# - name: Install requirements +# run: | +# python3 -m pip install -r requirements.txt +# python3 -m pip install -r requirements_test.txt +# - name: Run tests +# run: | +# pytest \ +# -qq \ +# --timeout=9 \ +# --durations=10 \ +# -n auto \ +# --cov custom_components.gigachat \ +# -o console_output_style=count \ +# -p no:sugar \ +# tests diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..1197364 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,63 @@ +name: Push actions + +on: + push: + branches: + - main + - rc-* + +env: + PYTHON_VERSION: "3.10" + +jobs: + validate: + runs-on: "ubuntu-latest" + name: Validate + steps: + - uses: "actions/checkout@v3.5.3" + + - 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.5.3" + - uses: "actions/setup-python@v4.7.0" + with: + python-version: ${{ env.PYTHON_VERSION }} + - 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.5.3" +# - name: Setup Python +# uses: "actions/setup-python@v4.7.0" +# with: +# python-version: ${{ env.PYTHON_VERSION }} +# - name: Install requirements +# run: | +# python3 -m pip install -r requirements.txt +# python3 -m pip install -r requirements_test.txt +# - name: Run tests +# run: | +# pytest \ +# -qq \ +# --timeout=9 \ +# --durations=10 \ +# -n auto \ +# --cov custom_components.gigachat \ +# -o console_output_style=count \ +# -p no:sugar \ +# tests diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ + diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100644 index 0000000..71f5999 --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1 @@ +pytest-homeassistant-custom-component