Chore: Add new drone step to validate OpenAPI specification (#75034)

* chore: add new drone step to validate openapi specification

* fix: update make before running make command
This commit is contained in:
Kat Yang 2023-09-20 11:46:15 -04:00 committed by GitHub
parent c8149d50f9
commit 24a1f12826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -439,6 +439,11 @@ steps:
- go run scripts/modowners/modowners.go check go.mod - go run scripts/modowners/modowners.go check go.mod
image: golang:1.20.8-alpine image: golang:1.20.8-alpine
name: validate-modfile name: validate-modfile
- commands:
- apk add --update make
- make validate-api-spec
image: golang:1.20.8-alpine
name: validate-openapi-spec
trigger: trigger:
event: event:
- pull_request - pull_request
@ -1623,6 +1628,11 @@ steps:
- go run scripts/modowners/modowners.go check go.mod - go run scripts/modowners/modowners.go check go.mod
image: golang:1.20.8-alpine image: golang:1.20.8-alpine
name: validate-modfile name: validate-modfile
- commands:
- apk add --update make
- make validate-api-spec
image: golang:1.20.8-alpine
name: validate-openapi-spec
- commands: - commands:
- ./bin/build verify-drone - ./bin/build verify-drone
depends_on: depends_on:
@ -4202,6 +4212,6 @@ kind: secret
name: gcr_credentials name: gcr_credentials
--- ---
kind: signature kind: signature
hmac: b7009bea932e621db567d1d9da72bd69d408c304585255e1c297dd63d60d956c hmac: 0b878d482338e27f3b8208271c974aa6c9cce0c4785eec59cf338464665b9ab5
... ...

View File

@ -10,6 +10,7 @@ load(
"lint_backend_step", "lint_backend_step",
"lint_drone_step", "lint_drone_step",
"validate_modfile_step", "validate_modfile_step",
"validate_openapi_spec_step",
"wire_install_step", "wire_install_step",
) )
load( load(
@ -46,6 +47,7 @@ def lint_backend_pipeline(trigger, ver_mode):
test_steps = [ test_steps = [
lint_backend_step(), lint_backend_step(),
validate_modfile_step(), validate_modfile_step(),
validate_openapi_spec_step(),
] ]
if ver_mode == "main": if ver_mode == "main":

View File

@ -226,6 +226,16 @@ def validate_modfile_step():
], ],
} }
def validate_openapi_spec_step():
return {
"name": "validate-openapi-spec",
"image": images["go"],
"commands": [
"apk add --update make",
"make validate-api-spec",
],
}
def dockerize_step(name, hostname, port): def dockerize_step(name, hostname, port):
return { return {
"name": name, "name": name,