diff --git a/.drone.yml b/.drone.yml index 0d2d5a8c682..2b1e0f5edc9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -439,6 +439,11 @@ steps: - go run scripts/modowners/modowners.go check go.mod image: golang:1.20.8-alpine name: validate-modfile +- commands: + - apk add --update make + - make validate-api-spec + image: golang:1.20.8-alpine + name: validate-openapi-spec trigger: event: - pull_request @@ -1623,6 +1628,11 @@ steps: - go run scripts/modowners/modowners.go check go.mod image: golang:1.20.8-alpine name: validate-modfile +- commands: + - apk add --update make + - make validate-api-spec + image: golang:1.20.8-alpine + name: validate-openapi-spec - commands: - ./bin/build verify-drone depends_on: @@ -4202,6 +4212,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: b7009bea932e621db567d1d9da72bd69d408c304585255e1c297dd63d60d956c +hmac: 0b878d482338e27f3b8208271c974aa6c9cce0c4785eec59cf338464665b9ab5 ... diff --git a/scripts/drone/pipelines/lint_backend.star b/scripts/drone/pipelines/lint_backend.star index 53877f889ba..1dd1f6e8833 100644 --- a/scripts/drone/pipelines/lint_backend.star +++ b/scripts/drone/pipelines/lint_backend.star @@ -10,6 +10,7 @@ load( "lint_backend_step", "lint_drone_step", "validate_modfile_step", + "validate_openapi_spec_step", "wire_install_step", ) load( @@ -46,6 +47,7 @@ def lint_backend_pipeline(trigger, ver_mode): test_steps = [ lint_backend_step(), validate_modfile_step(), + validate_openapi_spec_step(), ] if ver_mode == "main": diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 0ea0aa4432e..5d2910a1786 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -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): return { "name": name,