-
Notifications
You must be signed in to change notification settings - Fork 34
39 lines (35 loc) · 1.13 KB
/
check-protos.yml
File metadata and controls
39 lines (35 loc) · 1.13 KB
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
name: Check Generated Protos
on:
push:
paths:
- 'ldk-server-grpc/**'
pull_request:
paths:
- 'ldk-server-grpc/**'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-protos:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Install Rust stable toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Generate protos
run: RUSTFLAGS="--cfg genproto" cargo build -p ldk-server-grpc
- name: Format generated code
run: rustup component add rustfmt && cargo fmt --all
- name: Check for differences
run: |
if ! git diff --exit-code; then
echo "error: Generated protobuf files are out of date. Run: RUSTFLAGS=\"--cfg genproto\" cargo build -p ldk-server-grpc && cargo fmt --all"
exit 1
fi