From 30e4edc1ea4d5f9fcc67dbcd52b5d4e9ad1ed49d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Jul 2025 16:45:02 -1000 Subject: [PATCH 1/5] try another way --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/pre-commit-ci-lite.yml | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/pre-commit-ci-lite.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c043c25936..317c44a8d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -573,6 +573,25 @@ jobs: ./script/test_build_components -e compile -c $component done + pre-commit-ci-lite: + name: pre-commit.ci lite + runs-on: ubuntu-latest + needs: + - common + if: github.event_name == 'pull_request' && github.base_ref != 'beta' && github.base_ref != 'release' + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.2.2 + - name: Restore Python + uses: ./.github/actions/restore-python + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache-key: ${{ needs.common.outputs.cache-key }} + - uses: pre-commit/action@v3.0.1 + - name: Run pre-commit.ci lite + uses: pre-commit-ci/lite-action@v1.0.3 + if: always() + ci-status: name: CI Status runs-on: ubuntu-24.04 diff --git a/.github/workflows/pre-commit-ci-lite.yml b/.github/workflows/pre-commit-ci-lite.yml deleted file mode 100644 index 2f7cdd1176..0000000000 --- a/.github/workflows/pre-commit-ci-lite.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: pre-commit.ci lite - -on: - pull_request: - types: [labeled, opened, reopened, synchronize] - branches-ignore: - - beta - - release - -jobs: - pre-commit-ci-lite: - name: pre-commit.ci lite - runs-on: ubuntu-latest - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.2.2 - - name: Run pre-commit.ci lite - uses: pre-commit-ci/lite-action@v1.0.3 - if: always() From 6e4e334ae12838cd8f85f82fdfe7db2b66e986be Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Jul 2025 16:48:08 -1000 Subject: [PATCH 2/5] fixes --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 317c44a8d9..39f57d17a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -588,6 +588,8 @@ jobs: python-version: ${{ env.DEFAULT_PYTHON }} cache-key: ${{ needs.common.outputs.cache-key }} - uses: pre-commit/action@v3.0.1 + with: + extra_args: --all-files --skip pylint,clang-tidy-hash,yamllint - name: Run pre-commit.ci lite uses: pre-commit-ci/lite-action@v1.0.3 if: always() From 786de2a992ce674aa3d70fbbed015d33557048ad Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Jul 2025 16:50:31 -1000 Subject: [PATCH 3/5] fixes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39f57d17a4..1d4696c082 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -588,8 +588,8 @@ jobs: python-version: ${{ env.DEFAULT_PYTHON }} cache-key: ${{ needs.common.outputs.cache-key }} - uses: pre-commit/action@v3.0.1 - with: - extra_args: --all-files --skip pylint,clang-tidy-hash,yamllint + env: + SKIP: pylint,clang-tidy-hash,yamllint - name: Run pre-commit.ci lite uses: pre-commit-ci/lite-action@v1.0.3 if: always() From e80b11870f8f1fad12b3305b9112f251ce345cc2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Jul 2025 16:51:43 -1000 Subject: [PATCH 4/5] fixes --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d4696c082..01a5e322cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -582,11 +582,6 @@ jobs: steps: - name: Check out code from GitHub uses: actions/checkout@v4.2.2 - - name: Restore Python - uses: ./.github/actions/restore-python - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache-key: ${{ needs.common.outputs.cache-key }} - uses: pre-commit/action@v3.0.1 env: SKIP: pylint,clang-tidy-hash,yamllint From ac11018562a160567fad07614d7ef6f49bf3768c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 13 Jul 2025 16:54:25 -1000 Subject: [PATCH 5/5] fixes --- .github/workflows/ci.yml | 83 +--------------------------------------- 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01a5e322cc..5057e58a24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,52 +61,6 @@ jobs: pip install -r requirements.txt -r requirements_test.txt pip install -e . - ruff: - name: Check ruff - runs-on: ubuntu-24.04 - needs: - - common - - determine-jobs - if: needs.determine-jobs.outputs.python-linters == 'true' - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.2.2 - - name: Restore Python - uses: ./.github/actions/restore-python - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache-key: ${{ needs.common.outputs.cache-key }} - - name: Run Ruff - run: | - . venv/bin/activate - ruff format esphome tests - - name: Suggested changes - run: script/ci-suggest-changes - if: always() - - flake8: - name: Check flake8 - runs-on: ubuntu-24.04 - needs: - - common - - determine-jobs - if: needs.determine-jobs.outputs.python-linters == 'true' - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.2.2 - - name: Restore Python - uses: ./.github/actions/restore-python - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache-key: ${{ needs.common.outputs.cache-key }} - - name: Run flake8 - run: | - . venv/bin/activate - flake8 esphome - - name: Suggested changes - run: script/ci-suggest-changes - if: always() - pylint: name: Check pylint runs-on: ubuntu-24.04 @@ -248,7 +202,6 @@ jobs: outputs: integration-tests: ${{ steps.determine.outputs.integration-tests }} clang-tidy: ${{ steps.determine.outputs.clang-tidy }} - clang-format: ${{ steps.determine.outputs.clang-format }} python-linters: ${{ steps.determine.outputs.python-linters }} changed-components: ${{ steps.determine.outputs.changed-components }} component-test-count: ${{ steps.determine.outputs.component-test-count }} @@ -276,7 +229,6 @@ jobs: # Extract individual fields echo "integration-tests=$(echo "$output" | jq -r '.integration_tests')" >> $GITHUB_OUTPUT echo "clang-tidy=$(echo "$output" | jq -r '.clang_tidy')" >> $GITHUB_OUTPUT - echo "clang-format=$(echo "$output" | jq -r '.clang_format')" >> $GITHUB_OUTPUT echo "python-linters=$(echo "$output" | jq -r '.python_linters')" >> $GITHUB_OUTPUT echo "changed-components=$(echo "$output" | jq -c '.changed_components')" >> $GITHUB_OUTPUT echo "component-test-count=$(echo "$output" | jq -r '.component_test_count')" >> $GITHUB_OUTPUT @@ -317,41 +269,12 @@ jobs: . venv/bin/activate pytest -vv --no-cov --tb=native -n auto tests/integration/ - clang-format: - name: Check clang-format - runs-on: ubuntu-24.04 - needs: - - common - - determine-jobs - if: needs.determine-jobs.outputs.clang-format == 'true' - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.2.2 - - name: Restore Python - uses: ./.github/actions/restore-python - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache-key: ${{ needs.common.outputs.cache-key }} - - name: Install clang-format - run: | - . venv/bin/activate - pip install clang-format -c requirements_dev.txt - - name: Run clang-format - run: | - . venv/bin/activate - script/clang-format -i - git diff-index --quiet HEAD -- - - name: Suggested changes - run: script/ci-suggest-changes - if: always() - clang-tidy-deps: name: Clang-tidy dependencies runs-on: ubuntu-24.04 needs: - common - ci-custom - - clang-format - pytest - determine-jobs if: | @@ -576,8 +499,6 @@ jobs: pre-commit-ci-lite: name: pre-commit.ci lite runs-on: ubuntu-latest - needs: - - common if: github.event_name == 'pull_request' && github.base_ref != 'beta' && github.base_ref != 'release' steps: - name: Check out code from GitHub @@ -594,10 +515,7 @@ jobs: runs-on: ubuntu-24.04 needs: - common - - ruff - ci-custom - - clang-format - - flake8 - pylint - pytest - integration-tests @@ -608,6 +526,7 @@ jobs: - test-build-components - test-build-components-splitter - test-build-components-split + - pre-commit-ci-lite if: always() steps: - name: Success