Add linter for when people generate proto files inside the PR (#84)
This commit is contained in:
parent
6230edcb9f
commit
1fbf0396fe
|
@ -0,0 +1,37 @@
|
|||
name: Check protobuf generated files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- aioesphomeapi/api_options_pb2.py
|
||||
- aioesphomeapi/api_pb2.py
|
||||
|
||||
jobs:
|
||||
protoc-update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Install protoc
|
||||
run: |
|
||||
sudo apt-get install protobuf-compiler
|
||||
- name: Set up Python environment
|
||||
run: |
|
||||
pip3 install -e .
|
||||
pip3 install -r requirements_test.txt
|
||||
|
||||
- name: Generate protoc
|
||||
run: |
|
||||
script/gen-protoc
|
||||
|
||||
- name: Check changes
|
||||
run: |
|
||||
if ! git diff --quiet; then
|
||||
echo "You have altered the generated proto files but they do not match what is expected."
|
||||
echo "Please check your local protobuf-compiler version."
|
||||
protoc --version
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue