-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.44 KB
/
check_protobuf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Check_Protobuf
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, develop ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
check_protobuf_files:
name: Check that the protobuffiles for C and Python are up to date
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive
- name: Move tracked files
run: |
mv src/proto/protocol.pb.h src/proto/_protocol.pb.h
mv src/proto/protocol.pb.c src/proto/_protocol.pb.c
mv test/python/apps/pb/exchange_pb2.py test/python/apps/pb/_exchange_pb2.py
- name: Build proto files
run: |
make proto
- name: Check that there is no difference beside the date in the C files
run: |
diff <(grep -v "^/\* Generated by nanopb" src/proto/protocol.pb.c) <(grep -v "^/\* Generated by nanopb" src/proto/_protocol.pb.c)
diff <(grep -v "^/\* Generated by nanopb" src/proto/protocol.pb.h) <(grep -v "^/\* Generated by nanopb" src/proto/_protocol.pb.h)
- name: Check that there is no difference in the Python files
run: |
diff test/python/apps/pb/exchange_pb2.py test/python/apps/pb/_exchange_pb2.py