Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract swagger and openapi specs #966

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/actions/integration-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ inputs:
github-token:
description: 'GitHub token'
required: true
publish-swagger:
description: 'Optional: Publish Swagger and OpenAPI spec artifacts'
required: false
default: false
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -115,6 +119,36 @@ runs:
export VAULT_IMAGE_TAG='${{ inputs.vault-version }}-ent'
fi
make $make_target VERSION=${{ inputs.version }} INTEGRATION_TESTS_PARALLEL=true SUPPRESS_TF_OUTPUT=true EXPORT_KIND_LOGS_ROOT=${{ steps.create_kind_export_log_root.outputs.log_root }}
- name: Setup kubectl
if: success()
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
with:
version: latest
- name: Install swagger2openapi
if: success()
shell: bash
run: |
npm install -g swagger2openapi
- name: Retrieve and convert Kubernetes Swagger spec
if: success()
shell: bash
run: |
kubectl proxy &
sleep 5
curl http://localhost:8001/openapi/v2 > build/k8s-swagger-v2.json
swagger2openapi --outfile build/k8s-openapi-v3.json build/k8s-swagger-v2.json
- name: Store k8s-swagger-v2.json artifact
if: success() && inputs.publish-swagger == 'true'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: k8s-swagger-v2.json
path: build/k8s-swagger-v2.json
- name: Store k8s-openapi-v3.json artifact
if: success() && inputs.publish-swagger == 'true'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: k8s-openapi-v3.json
path: build/k8s-openapi-v3.json
- name: Store kind cluster logs
if: success()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ jobs:
hcp-client-secret: ${{ secrets.HCP_CLIENT_SECRET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
log-prefix: "latest-k8s-"
publish-swagger: "true"

# This job is used as a requirement for the repo's branch protection setup.
build-done:
Expand Down
Loading