Skip to content

protocol buffer 環境を作成しました #6

protocol buffer 環境を作成しました

protocol buffer 環境を作成しました #6

Workflow file for this run

name: ci
on: pull_request
jobs:
protobuf-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_SECRET_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.2"
# 参照
# https://github.com/protocolbuffers/protobuf/blob/main/cmake/README.md#linux-builds
# https://protobuf.dev/getting-started/gotutorial/
- name: Install Protobuf
run: |
sudo apt-get install make -y
git clone [email protected]:protocolbuffers/protobuf.git
cd protobuf
cmake .
cmake --build . --parallel 10
ctest --verbose
sudo cmake --install .
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- name: Run protoc
run: |
make generate_proto
- name: Check for changes
id: git-check
run: |
git diff --exit-code api/gen
continue-on-error: true
- name: Fail if changes are detected
if: steps.git-check.outcome == 'failure'
run: |
echo "Changes detected in api/gen directory!"
exit 1