Skip to content

protobuf

protobuf #11

Workflow file for this run

name: protobuf
on:
pull_request:
workflow_dispatch:
jobs:
protobuf:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protobuf
uses: mamba-org/setup-micromamba@v1
with:
environment-name: protobuf
create-args: protobuf
- name: Install Bufbuild
run: |
# NOTE: bufbuild does exist on conda-forge but hasn't been updated for a while
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install bufbuild/buf/buf
buf --help
- name: Lint
run: |
# lint .proto files
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
cd proto
buf lint
- name: Build
run: |
# generate .py and .pyi files from the .proto files
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
micromamba activate protobuf
cd proto
buf generate
- name: Configure git
uses: cylc/release-actions/configure-git@v1
- name: Commit & Push
run: |
if [[ -z $(git diff --stat -- "$INIT_FILE") ]]; then
echo "::error:: No changes to ${INIT_FILE} occurred"
exit 0
else
echo "::info:: pushing update commit"
git commit -am 'protobuf: updating generated files'
git push
exit 0
fi