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

ci: add test for validation failures #1102

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ jobs:
with:
rdme: openapi:validate "oas-examples-repo/3.1/json/petstore.json"

- name: Run `openapi:validate` on an invalid file
uses: ./rdme-repo/
id: openapi-validate-fail
continue-on-error: true
with:
rdme: openapi:validate rdme-repo/__tests__/__fixtures__/invalid-oas.json

- name: Assert that previous validation step failed
if: ${{ steps.openapi-validate-fail.outcome == 'failure' }}
run: echo "The validation in the previous step failed as expected."

- name: Throw error if previous validation step did not fail
if: ${{ steps.openapi-validate-fail.outcome == 'success' }}
run: echo "::error::Expected validation in previous step to fail" && exit 1

# Docs: https://rdme-test.readme.io
- name: Run `openapi` command
uses: ./rdme-repo/
Expand Down
Loading