-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (67 loc) · 2.13 KB
/
pr-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "PR checks"
on:
pull_request:
permissions:
contents: read
env:
GO_VERSION: 1.20.7
jobs:
lint-protos:
runs-on: ubuntu-latest
steps:
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v3
# Lint your Protobuf sources
- uses: bufbuild/buf-lint-action@v1
with:
input: protobuf
buf-format:
runs-on: ubuntu-latest
steps:
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Buf format check
run: buf format -d --exit-code
buf-breaking-changes:
runs-on: ubuntu-latest
steps:
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v3
# Run breaking change detection against the last commit
- uses: bufbuild/buf-breaking-action@v1
with:
input: protobuf
against: 'https://github.com/open-feature/schemas.git#branch=main,ref=HEAD~1,subdir=protobuf'
validate-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Use ajv to validate schema
- name: Setup node
uses: actions/setup-node@v3.8.1
- name: Validate schema
run: make ajv-validate-flagd-schema
# Run go test suite to validate the json schema against positive and/or negative validations in /json/test
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Validate Schema
run: go test -v ./json
# Ensure there is no diff when make gen-schema-json is run
- run: make gen-schema-json
- name: Check no diff
run: |
if [ ! -z "$(git status --porcelain)" ]; then echo "JSON schema generation produced diff. Run 'make gen-schema-json' and commit results."; exit 1; fi