Skip to content

Update apps (#9)

Update apps (#9) #31

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