Browse Source

github action: Add buf-lint, fix buf (#10307)

* github action: Add buf-lint, fix buf

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
pull/10076/head
Julien Pivotto 3 years ago committed by GitHub
parent
commit
e239e3ee8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      .github/workflows/buf-lint.yml
  2. 5
      .github/workflows/buf.yml
  3. 14
      prompb/buf.yaml

20
.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'

5
.github/workflows/buf.yml

@ -1,9 +1,12 @@
name: buf.build
on: on:
push: push:
branches: branches:
- main - main
jobs: jobs:
buf:
name: lint and publish
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.6.0 - uses: bufbuild/buf-setup-action@v0.6.0

14
prompb/buf.yaml

@ -1,4 +1,18 @@
version: v1 version: v1
name: buf.build/prometheus/prometheus 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: deps:
- buf.build/gogo/protobuf - buf.build/gogo/protobuf

Loading…
Cancel
Save