-
-
Notifications
You must be signed in to change notification settings - Fork 16
Improve CI/CD: labeling, auto-merge, workflow organization, and Python checks #794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4e9aa0b
Replace release-drafter autolabeler with dedicated labeling actions
raman325 5109611
Add CI gate workflow to wait for all checks
raman325 c097ba8
Add initial delay to CI gate to let other workflows start
raman325 0533002
Move path filtering from trigger to job-level conditions
raman325 95c29dd
Address Copilot review comments on labeler config
raman325 71d7383
Add settle period to CI gate for late-arriving checks
raman325 c23d5c2
Replace CI gate with explicit check polling in auto-merge
raman325 52c6d19
Add initial delay to auto-merge check polling
raman325 95c567c
Combine frontend and integration workflows
raman325 470487d
Refactor to reusable workflows for better UI hierarchy
raman325 c9633a3
Rename Python caller job to Integration
raman325 eb63403
Separate HACS and Hassfest with proper path filters
raman325 df45044
Simplify HACS and Hassfest to always run
raman325 7a9fc74
Add Ruff and Mypy checks, run Pytest on Python 3.13 and 3.14
raman325 142e5ba
Remove mypy from CI, add TODO for type checking
raman325 9254ca9
Use variables for Python versions in CI matrix
raman325 db187bd
Support pattern matching for auto-merge check names
raman325 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Configuration for github/issue-labeler - body-based labels | ||
| # See: https://github.com/github/issue-labeler | ||
| # Uses regex patterns to match PR/issue body content | ||
| # Note: [xX] matches both lowercase and uppercase X in checkboxes | ||
| --- | ||
| bug: | ||
| - '\[[xX]\]\s*[Bb]ugfix' | ||
|
|
||
| enhancement: | ||
| - '\[[xX]\]\s*[Nn]ew [Ff]eature' | ||
|
|
||
| breaking-change: | ||
| - '\[[xX]\]\s*[Bb]reaking [Cc]hange' | ||
|
|
||
| code-quality: | ||
| - '\[[xX]\]\s*[Cc]ode [Qq]uality' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Configuration for actions/labeler - file-based labels | ||
| # See: https://github.com/actions/labeler | ||
| --- | ||
| pre-commit: | ||
| - changed-files: | ||
| - any-glob-to-any-file: '.pre-commit-config.yaml' | ||
|
|
||
| javascript: | ||
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - '*.ts' | ||
| - '*.js' | ||
| - 'ts/**/*' | ||
| - '.eslintrc.cjs' | ||
| - 'tsconfig.json' | ||
| - 'rollup.config.js' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - 'yarn.lock' | ||
|
|
||
| python: | ||
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - '*.py' | ||
| - 'custom_components/**/*.py' | ||
| - 'tests/**/*.py' | ||
| - 'tox.ini' | ||
| - 'requirements*.txt' | ||
| - 'pyproject.toml' | ||
| - 'Pipfile' | ||
| - 'Pipfile.lock' | ||
|
|
||
| github_actions: | ||
| - changed-files: | ||
| - any-glob-to-any-file: '.github/workflows/**/*' | ||
|
|
||
| dependencies: | ||
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - 'requirements*.txt' | ||
| - 'pyproject.toml' | ||
| - 'Pipfile' | ||
| - 'Pipfile.lock' | ||
| - 'package.json' | ||
| - 'package-lock.json' | ||
| - 'yarn.lock' | ||
| - '.pre-commit-config.yaml' | ||
|
|
||
| documentation: | ||
| - changed-files: | ||
| - any-glob-to-any-file: | ||
| - '*.md' | ||
| - '**/*.md' | ||
| - 'docs/**/*' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| name: Labeler | ||
|
|
||
| # yamllint disable-line rule:truthy | ||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - edited | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| label-files: | ||
| name: Label by Files | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/labeler@v5 | ||
| with: | ||
| sync-labels: true | ||
|
|
||
| label-body: | ||
| name: Label by Body | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: github/issue-labeler@v3 | ||
| with: | ||
| configuration-path: .github/issue-labeler.yml | ||
| enable-versioned-regex: 0 | ||
| sync-labels: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| name: Python Checks | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| env: | ||
| # Target Python version for coverage and static analysis | ||
| TARGET_PYTHON: "3.13" | ||
| # Additional Python versions to test (JSON array, can be empty: '[]') | ||
| OTHER_PYTHON_VERSIONS: '["3.14"]' | ||
|
|
||
| jobs: | ||
| setup: | ||
| name: Setup | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| target-python: ${{ env.TARGET_PYTHON }} | ||
| python-versions: ${{ steps.versions.outputs.matrix }} | ||
| steps: | ||
| - name: Build version matrix | ||
| id: versions | ||
| run: | | ||
| # Combine target with other versions into a JSON array | ||
| MATRIX=$(echo '${{ env.OTHER_PYTHON_VERSIONS }}' | jq -c '. + ["${{ env.TARGET_PYTHON }}"] | unique | sort') | ||
| echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT" | ||
|
|
||
| ruff: | ||
| name: Ruff | ||
| needs: setup | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ needs.setup.outputs.target-python }} | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| - name: Install dependencies | ||
| run: uv pip install --system ruff | ||
| - name: Check formatting | ||
| run: ruff format --check . | ||
| - name: Check linting | ||
| run: ruff check . | ||
|
|
||
| pytest: | ||
| name: Pytest (${{ matrix.python-version }}) | ||
| needs: setup | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ${{ fromJSON(needs.setup.outputs.python-versions) }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| allow-prereleases: true | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install libudev-dev | ||
| - name: Install dependencies | ||
| run: uv pip install --system -r requirements_dev.txt | ||
| - name: Run tests and generate coverage report | ||
| # CI-only deps installed separately to keep requirements_dev.txt lightweight | ||
| run: | | ||
| uv pip install --system pytest-cov pytest-github-actions-annotate-failures | ||
| pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml | ||
| - name: Upload coverage to Codecov | ||
| if: matrix.python-version == needs.setup.outputs.target-python | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: python | ||
| files: coverage.xml |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.