Skip to content

Commit

Permalink
ci: add a script and CI job to validate spec examples (#1046)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Moya <[email protected]>
  • Loading branch information
AnimeshKumar923 and smoya authored Apr 29, 2024
1 parent 7c0c43c commit eda8937
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/validate-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate AsyncAPI Examples

on:
pull_request_target:
types: [opened, reopened, synchronize, edited, ready_for_review]

jobs:
validate-examples:
name: Validate Spec Examples
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install AsyncAPI CLI
run: npm install -g @asyncapi/cli
- name: Validate AsyncAPI documents
run: |
find examples -type f \( -name "*.yml" -o -name "*.yaml" \) -not -path 'examples/social-media/common/*' | xargs -P 10 -L 1 asyncapi validate
# NOTE: we've excluded the files inside `examples/social-media/common` folder because it contains partial documents which don't comply with the asyncapi document format, hence these files give error during the validation.

0 comments on commit eda8937

Please sign in to comment.