Skip to content

protobuf: add a new field #17

protobuf: add a new field

protobuf: add a new field #17

Workflow file for this run

name: protobuf
on:
pull_request:
# NOTE: don't run this on "workflow_dispatch" or "schedule" as it will commit
# directly to the branch
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
init-shell: bash
- 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
shell: bash -el {0}
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) ]]; then
echo '::error:: No functional changes made to the protobuf schema'
exit 0
else
echo '::info:: pushing update commit'
git add -u
git commit -m 'protobuf: updating generated files'
git push
exit 0
fi