From 680448bd3baff0251b70c9a2c1599e8d36df56df Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 11 Mar 2022 02:05:21 +0000 Subject: [PATCH 1/5] ci: add swagger check --- .github/actions/generate-swagger/action.yml | 7 +++++++ .github/workflows/proto.yml | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .github/actions/generate-swagger/action.yml diff --git a/.github/actions/generate-swagger/action.yml b/.github/actions/generate-swagger/action.yml new file mode 100644 index 0000000000..34644a6593 --- /dev/null +++ b/.github/actions/generate-swagger/action.yml @@ -0,0 +1,7 @@ +name: generate swagger +description: generate swagger files based on protobuf +runs: + using: "composite" + steps: + - run: make proto-swagger-gen + - run: make update-swagger-docs diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 832fa81d63..4bc042d66c 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -19,6 +19,17 @@ jobs: extensions: 'proto' clangFormatVersion: 12 inplace: True + swagger: + name: check generated swagger files + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.2.0 + with: + go-version: 1.15 + - uses: ./.github/actions/generate-swagger + - run: git diff-index --quiet HEAD + # TODO ebony: release comment after merging initial proto files to v2 branch # breakage: # runs-on: ubuntu-latest From c3688e18ee7f0f03ef1842a04090611306e0c483 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 11 Mar 2022 02:10:27 +0000 Subject: [PATCH 2/5] ci: add failure (revert it) --- proto/lbm/consortium/v1/query.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proto/lbm/consortium/v1/query.proto b/proto/lbm/consortium/v1/query.proto index 1e693cc0ff..01cc52af68 100644 --- a/proto/lbm/consortium/v1/query.proto +++ b/proto/lbm/consortium/v1/query.proto @@ -23,6 +23,11 @@ service Query { rpc ValidatorAuths(QueryValidatorAuthsRequest) returns (QueryValidatorAuthsResponse) { option (google.api.http).get = "/lbm/consortium/v1/validators"; } + + // Test queries authorization infos of validators. + rpc Test(QueryValidatorAuthsRequest) returns (QueryValidatorAuthsResponse) { + option (google.api.http).get = "/lbm/consortium/v1/validators"; + } } // QueryParamsRequest is the request type for the Query/Params RPC method. From 6ae36434ebcdbe216b38efa36cbd9f117479227c Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 11 Mar 2022 02:24:45 +0000 Subject: [PATCH 3/5] ci: fix syntax errors --- .github/actions/generate-swagger/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/generate-swagger/action.yml b/.github/actions/generate-swagger/action.yml index 34644a6593..36062105fb 100644 --- a/.github/actions/generate-swagger/action.yml +++ b/.github/actions/generate-swagger/action.yml @@ -4,4 +4,6 @@ runs: using: "composite" steps: - run: make proto-swagger-gen + shell: sh - run: make update-swagger-docs + shell: sh From 2e0c878e518b82a797ca411363e25d8955566cbd Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 11 Mar 2022 02:28:40 +0000 Subject: [PATCH 4/5] Revert "ci: add failure (revert it)" This reverts commit c3688e18ee7f0f03ef1842a04090611306e0c483. --- proto/lbm/consortium/v1/query.proto | 5 ----- 1 file changed, 5 deletions(-) diff --git a/proto/lbm/consortium/v1/query.proto b/proto/lbm/consortium/v1/query.proto index 01cc52af68..1e693cc0ff 100644 --- a/proto/lbm/consortium/v1/query.proto +++ b/proto/lbm/consortium/v1/query.proto @@ -23,11 +23,6 @@ service Query { rpc ValidatorAuths(QueryValidatorAuthsRequest) returns (QueryValidatorAuthsResponse) { option (google.api.http).get = "/lbm/consortium/v1/validators"; } - - // Test queries authorization infos of validators. - rpc Test(QueryValidatorAuthsRequest) returns (QueryValidatorAuthsResponse) { - option (google.api.http).get = "/lbm/consortium/v1/validators"; - } } // QueryParamsRequest is the request type for the Query/Params RPC method. From a4a669d4d8636f41025a2786c7e7b5ba540ab150 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Fri, 11 Mar 2022 02:33:54 +0000 Subject: [PATCH 5/5] docs: add CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36471f28e9..e5486ee562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,4 +47,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Build, CI +* (ci) [\#457](https://github.com/line/lbm-sdk/pull/457) add swagger check + ### Document Updates