diff --git a/.github/workflows/buf-lint.yml b/.github/workflows/buf-lint.yml new file mode 100644 index 000000000..e5ff2ef03 --- /dev/null +++ b/.github/workflows/buf-lint.yml @@ -0,0 +1,20 @@ +name: buf.build +on: + pull_request: + paths: + - ".github/workflows/buf-lint.yml" + - "**.proto" +jobs: + buf: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: bufbuild/buf-setup-action@v0.6.0 + - uses: bufbuild/buf-lint-action@v1 + with: + input: 'prompb' + - uses: bufbuild/buf-breaking-action@v1 + with: + input: 'prompb' + against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD,subdir=prompb' diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml index 0de1aed6c..d7019544c 100644 --- a/.github/workflows/buf.yml +++ b/.github/workflows/buf.yml @@ -1,20 +1,23 @@ +name: buf.build on: push: branches: - main - jobs: - steps: - - uses: actions/checkout@v2 - - uses: bufbuild/buf-setup-action@v0.6.0 - - uses: bufbuild/buf-lint-action@v1 - with: - input: 'prompb' - - uses: bufbuild/buf-breaking-action@v1 - with: - input: 'prompb' - against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD~1,subdir=prompb' - - uses: bufbuild/buf-push-action@v1 - with: - input: 'prompb' - buf_token: ${{ secrets.BUF_TOKEN }} + buf: + name: lint and publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: bufbuild/buf-setup-action@v0.6.0 + - uses: bufbuild/buf-lint-action@v1 + with: + input: 'prompb' + - uses: bufbuild/buf-breaking-action@v1 + with: + input: 'prompb' + against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD~1,subdir=prompb' + - uses: bufbuild/buf-push-action@v1 + with: + input: 'prompb' + buf_token: ${{ secrets.BUF_TOKEN }} diff --git a/prompb/buf.yaml b/prompb/buf.yaml index 694880a26..acd7af9cf 100644 --- a/prompb/buf.yaml +++ b/prompb/buf.yaml @@ -1,4 +1,18 @@ version: v1 name: buf.build/prometheus/prometheus +lint: + ignore_only: + ENUM_VALUE_PREFIX: + - remote.proto + - types.proto + ENUM_ZERO_VALUE_SUFFIX: + - remote.proto + - types.proto + PACKAGE_DIRECTORY_MATCH: + - remote.proto + - types.proto + PACKAGE_VERSION_SUFFIX: + - remote.proto + - types.proto deps: - buf.build/gogo/protobuf