-
Notifications
You must be signed in to change notification settings - Fork 29
74 lines (63 loc) · 2.05 KB
/
starknet_p2p_specs_ci.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Starknet-P2p-Specs-CI
on:
workflow_dispatch:
pull_request:
branches:
- '*'
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
env:
PROTOC_VERSION: v25.1
jobs:
compile-protos:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- uses: Noelware/[email protected]
with:
version: ${{env.PROTOC_VERSION}}
- name: Find .proto files
id: find-protos
run: |
proto_files=$(find . -name "*.proto")
if [ -z "$proto_files" ]; then
echo "No .proto files found."
exit 1
fi
echo "Found the following .proto files:"
echo "$proto_files"
# Save the list as an output
echo "proto_files=$(echo "$proto_files" | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Validate Rust compatibility
run: |
for file in ${{ steps.find-protos.outputs.proto_files }}; do
echo "Compiling $file"
protoc --rust_out=experimental-codegen=enabled,kernel=upb:$(mktemp -d) $file
done
- name: Validate Python compatibility
run: |
for file in ${{ steps.find-protos.outputs.proto_files }}; do
echo "Compiling $file"
protoc --python_out=$(mktemp -d) $file
done
- name: Validate C++ compatibility
run: |
for file in ${{ steps.find-protos.outputs.proto_files }}; do
echo "Compiling $file"
protoc --cpp_out=$(mktemp -d) $file
done
- name: Validate GO compatibility
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
export PATH=$PATH:$(go env GOPATH)/bin
for file in ${{ steps.find-protos.outputs.proto_files }}; do
echo "Compiling $file"
protoc --go_out=$(mktemp -d) --go_opt=paths=source_relative $file
done
- name: Success Message
run: echo "All proto compilations passed!"