-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade buf yaml config and CI (#14)
This PR upgrades the config for buf modules, fixing lint checks, and updating the CI to push the main module. The config file is upgraded to v2 (follows this [guide](https://buf.build/docs/migration-guides/migrate-v2-config-files)). Ran `buf lint` and corrected the CEL expression on the `Interval` type. Uses [buf-action](https://github.com/bufbuild/buf-action) config to run build, checks (lint, format, breaking), and push on each feature branch and main to the BSR. Please see commit-by-commit for a breakdown of the steps. There are a couple of behaviour changes in this PR. This implements the [default behaviour](https://github.com/bufbuild/buf-action?tab=readme-ov-file#default-behavior) as described in the buf-action repo. Every push will now sync with the BSR. On pull requests checks will be run. On merging to main the deleted branch will be archived and the latest on main synced.
- Loading branch information
1 parent
c625048
commit 32fab75
Showing
10 changed files
with
87 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
--- | ||
name: build-and-publish-protos | ||
name: build-test-and-publish-protos | ||
on: | ||
push: | ||
paths: | ||
- .github/workflows/build-and-publish-protos.yaml | ||
- 'proto/**' | ||
- buf.yaml | ||
- buf.lock | ||
pull_request: | ||
paths: | ||
- 'proto/**/*.proto' | ||
- .github/workflows/build-and-publish-protos.yaml | ||
- 'proto/**' | ||
- buf.yaml | ||
- buf.lock | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
delete: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
jobs: | ||
build-and-publish-protos: | ||
buf: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: bufbuild/[email protected] | ||
|
||
- name: Verify that protos build. | ||
run: buf build | ||
|
||
- id: push-aep-type | ||
uses: bufbuild/buf-push-action@v1 | ||
with: | ||
buf_token: ${{ secrets.BUF_TOKEN }} | ||
input: proto/aep-type | ||
draft: ${{ github.ref_name != 'main'}} | ||
|
||
- id: push-aep-api | ||
uses: bufbuild/buf-push-action@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: bufbuild/[email protected] | ||
with: | ||
buf_token: ${{ secrets.BUF_TOKEN }} | ||
input: proto/aep-api | ||
draft: ${{ github.ref_name != 'main'}} | ||
token: ${{ secrets.BUF_TOKEN }} | ||
pr_comment: false | ||
format: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v2 | ||
deps: | ||
- name: buf.build/bufbuild/protovalidate | ||
commit: f05a6f4403ce4327bae4f50f281c3ed0 | ||
digest: b5:f1d76430ee97c89cd2044e9ae1c510887b701ee7bca60564ebf82e3919e53cacefc830a0eb803277c2d98c5f313b4167e8914afc9f214332717a50b5e170e6f4 | ||
- name: buf.build/googleapis/googleapis | ||
commit: 7a6bc1e3207144b38e9066861e1de0ff | ||
digest: b5:6d05bde5ed4cd22531d7ca6467feb828d2dc45cc9de12ce3345fbddd64ddb1bf0db756558c32ca49e6bc7de4426ada8960d5590e8446854b81f5f36f0916dc48 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
version: v2 | ||
modules: | ||
- path: proto/aep-api | ||
name: buf.build/aep/api | ||
lint: | ||
use: | ||
- DEFAULT | ||
except: | ||
- FIELD_NOT_REQUIRED | ||
- PACKAGE_NO_IMPORT_CYCLE | ||
- PACKAGE_VERSION_SUFFIX | ||
disallow_comment_ignores: true | ||
breaking: | ||
use: | ||
- FILE | ||
except: | ||
- EXTENSION_NO_DELETE | ||
- FIELD_SAME_DEFAULT | ||
- path: proto/aep-conformance | ||
name: buf.build/aep/conformance | ||
lint: | ||
use: | ||
- DEFAULT | ||
except: | ||
- ENUM_VALUE_PREFIX | ||
- ENUM_ZERO_VALUE_SUFFIX | ||
- FIELD_NOT_REQUIRED | ||
- PACKAGE_NO_IMPORT_CYCLE | ||
- PACKAGE_VERSION_SUFFIX | ||
disallow_comment_ignores: true | ||
breaking: | ||
use: | ||
- FILE | ||
except: | ||
- EXTENSION_NO_DELETE | ||
- FIELD_SAME_DEFAULT | ||
- path: proto/aep-type | ||
name: buf.build/aep/type | ||
lint: | ||
use: | ||
- DEFAULT | ||
except: | ||
- FIELD_NOT_REQUIRED | ||
- PACKAGE_NO_IMPORT_CYCLE | ||
- PACKAGE_VERSION_SUFFIX | ||
disallow_comment_ignores: true | ||
breaking: | ||
use: | ||
- FILE | ||
except: | ||
- EXTENSION_NO_DELETE | ||
- FIELD_SAME_DEFAULT | ||
deps: | ||
- buf.build/bufbuild/protovalidate | ||
- buf.build/googleapis/googleapis |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.