-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
61 lines (61 loc) · 1.88 KB
/
action.yaml
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
name: 'Buf generate'
description: 'Uses Buf to generate compiled protos'
inputs:
working-directory:
description: Working directory
required: false
default: ${{ github.workspace }}
python-version:
description: Python version to compile python protos against
required: false
default: '3.10.x'
runs:
using: composite
steps:
- name: Install Buf
uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}
version: 1.26.1
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: Setup cache
uses: actions/cache@v2
with:
# In order:
# * go Module download cache
# * go Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ inputs.github-token }}
- name: Install go dependencies
shell: bash
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Install npm dependencies
shell: bash
run: |
npm install grpc-tools grpc_tools_node_protoc_ts --global
- name: Install python dependencies # We use betterproto https://github.com/danielgtaylor/python-betterproto to generate python grpc code, so we have to install it
shell: bash
run: |
pip install "betterproto[compiler]" grpclib protobuf
- name: Run buf generate
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
buf generate