mirror of
https://github.com/esphome/esphome.git
synced 2026-05-19 03:01:49 +08:00
01addeae08
CI / Create common environment (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (macOS-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.13) (push) Has been cancelled
CI / Run pytest (windows-latest, 3.11) (push) Has been cancelled
CI / Determine which jobs to run (push) Has been cancelled
CI / Run integration tests (push) Has been cancelled
CI / Run C++ unit tests (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / Run script/clang-tidy for ZEPHYR (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Test components batch (${{ matrix.components }}) (push) Has been cancelled
CI / pre-commit.ci lite (push) Has been cancelled
CI / Build target branch for memory impact (push) Has been cancelled
CI / Build PR branch for memory impact (push) Has been cancelled
CI / Comment memory impact (push) Has been cancelled
CI / CI Status (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04-arm) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04-arm) (push) Has been cancelled
Stale / stale (push) Has been cancelled
Lock closed issues and PRs / lock (push) Has been cancelled
Publish Release / Initialize build (push) Has been cancelled
Publish Release / Build and publish to PyPi (push) Has been cancelled
Publish Release / Build ESPHome amd64 (push) Has been cancelled
Publish Release / Build ESPHome arm64 (push) Has been cancelled
Publish Release / Publish ESPHome docker to dockerhub (push) Has been cancelled
Publish Release / Publish ESPHome docker to ghcr (push) Has been cancelled
Publish Release / Publish ESPHome ha-addon to dockerhub (push) Has been cancelled
Publish Release / Publish ESPHome ha-addon to ghcr (push) Has been cancelled
Publish Release / deploy-ha-addon-repo (push) Has been cancelled
Publish Release / deploy-esphome-schema (push) Has been cancelled
Synchronise Device Classes from Home Assistant / Sync Device Classes (push) Has been cancelled
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
92 lines
3.4 KiB
YAML
92 lines
3.4 KiB
YAML
name: API Proto CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "esphome/components/api/api.proto"
|
|
- "esphome/components/api/api_pb2.cpp"
|
|
- "esphome/components/api/api_pb2.h"
|
|
- "esphome/components/api/api_pb2_service.cpp"
|
|
- "esphome/components/api/api_pb2_service.h"
|
|
- "script/api_protobuf/api_protobuf.py"
|
|
- ".github/workflows/ci-api-proto.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
check:
|
|
name: Check generated files
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
|
- name: Set up Python
|
|
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install apt dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt-cache show protobuf-compiler
|
|
sudo apt install -y protobuf-compiler
|
|
protoc --version
|
|
- name: Install python dependencies
|
|
run: pip install aioesphomeapi -c requirements.txt -r requirements_dev.txt
|
|
- name: Generate files
|
|
run: script/api_protobuf/api_protobuf.py
|
|
- name: Check for changes
|
|
run: |
|
|
if ! git diff --quiet; then
|
|
echo "## Job Failed" | tee -a $GITHUB_STEP_SUMMARY
|
|
echo "You have altered the generated proto files but they do not match what is expected." | tee -a $GITHUB_STEP_SUMMARY
|
|
echo "Please run 'script/api_protobuf/api_protobuf.py' and commit the changes." | tee -a $GITHUB_STEP_SUMMARY
|
|
exit 1
|
|
fi
|
|
- if: failure()
|
|
name: Review PR
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
script: |
|
|
await github.rest.pulls.createReview({
|
|
pull_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
event: 'REQUEST_CHANGES',
|
|
body: 'You have altered the generated proto files but they do not match what is expected.\nPlease run "script/api_protobuf/api_protobuf.py" and commit the changes.'
|
|
})
|
|
- if: failure()
|
|
name: Show changes
|
|
run: git diff
|
|
- if: failure()
|
|
name: Archive artifacts
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: generated-proto-files
|
|
path: |
|
|
esphome/components/api/api_pb2.*
|
|
esphome/components/api/api_pb2_service.*
|
|
- if: success()
|
|
name: Dismiss review
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
script: |
|
|
let reviews = await github.rest.pulls.listReviews({
|
|
pull_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo
|
|
});
|
|
for (let review of reviews.data) {
|
|
if (review.user.login === 'github-actions[bot]' && review.state === 'CHANGES_REQUESTED') {
|
|
await github.rest.pulls.dismissReview({
|
|
pull_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
review_id: review.id,
|
|
message: 'Files now match the expected proto files.'
|
|
});
|
|
}
|
|
}
|