ci: add a script and CI job to validate spec examples #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate AsyncAPI Examples | ||
on: | ||
push: | ||
branches: | ||
- script-ci-spec-validation # added temporarily for testing purpose | ||
# - master | ||
pull_request_target: | ||
types: [opened, reopened, synchronize, edited, ready_for_review] | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: 'Enter something' | ||
required: true | ||
jobs: | ||
validate-examples: | ||
name: Validate Spec Examples - ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Find YAML files | ||
run: | | ||
files=$(find examples/ \( -path 'examples/social-media/*' -prune \) -o -type f \( -name "*.yml" -o -name "*.yaml" \)) | ||
echo "::set-output name=files::$files" | ||
- name: Validate AsyncAPI documents | ||
uses: asyncapi/[email protected] | ||
with: | ||
command: custom | ||
arguments: | | ||
validate ${{ steps.FindYAMLFiles.outputs.files }} |