protocol_compatibility.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright (c) 2020-2021 Project CHIP Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: Backwards compatibility check
  15. on:
  16. pull_request:
  17. paths:
  18. - "src/controller/data_model/controller-clusters.matter"
  19. jobs:
  20. check_clusters_matter:
  21. name: Check controller-clusters.matter backwards compatibility
  22. runs-on: ubuntu-latest
  23. if: github.event.pull_request && !(contains(github.event.pull_request.labels.*.name, 'skip-protocol-compatibility'))
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@v4
  27. - name: Setup python
  28. uses: actions/setup-python@v4
  29. with:
  30. python-version: 3.11
  31. - name: Install dependencies
  32. run: |
  33. python -m pip install --upgrade pip
  34. pip install click coloredlogs lark
  35. - name: Create old/new copies
  36. run: |
  37. mkdir -p out
  38. cp src/controller/data_model/controller-clusters.matter out/new_version.matter
  39. wget '${{github.event.pull_request.diff_url}}' --output-document out/patch.diff
  40. patch -p1 --reverse <out/patch.diff
  41. cp src/controller/data_model/controller-clusters.matter out/old_version.matter
  42. patch -p1 <out/patch.diff
  43. - name: Check backwards compatibility
  44. run: |
  45. scripts/backwards_compatibility_checker.py out/old_version.matter out/new_version.matter