-
Notifications
You must be signed in to change notification settings - Fork 36
32 lines (30 loc) · 1.02 KB
/
check-protos.yml
File metadata and controls
32 lines (30 loc) · 1.02 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
name: Check Generated Protos
on:
push:
paths:
- 'ldk-server-protos/**'
pull_request:
paths:
- 'ldk-server-protos/**'
workflow_dispatch:
jobs:
check-protos:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- 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-protos
- 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-protos && cargo fmt --all"
exit 1
fi