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 a script and CI job to validate spec examples #1046

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
178cf39
feat: add new workflow to validate example
AnimeshKumar923 Mar 7, 2024
ce9b567
chore: update checkout action version
AnimeshKumar923 Mar 7, 2024
883b13c
fix: add YAML extension support
AnimeshKumar923 Mar 7, 2024
7fe9564
chore: add current testing branch in workflow
AnimeshKumar923 Mar 11, 2024
1e22e40
chore: update workflow version
AnimeshKumar923 Mar 11, 2024
f5a1a98
chore: update workflow version
AnimeshKumar923 Mar 11, 2024
b7da489
fix: update code to match workflow
AnimeshKumar923 Mar 11, 2024
fb898a4
fix: update code to match workflow
AnimeshKumar923 Mar 11, 2024
65c8f15
chore: update code
AnimeshKumar923 Mar 11, 2024
dacaf85
fix: update code, script in working condition
AnimeshKumar923 Mar 15, 2024
d3427b8
fix: update package.json, workflow file
AnimeshKumar923 Mar 15, 2024
37ba41b
chore: migrate package.json to root
AnimeshKumar923 Mar 15, 2024
9e7f840
fix: update script and yaml file
AnimeshKumar923 Mar 15, 2024
8a34862
chore: add \n for better readability
AnimeshKumar923 Mar 15, 2024
ba7a2a0
fix: update script, add error files information
AnimeshKumar923 Mar 15, 2024
ccc2e93
Merge branch 'master' into script-ci-spec-validation
AnimeshKumar923 Mar 24, 2024
abbda0d
fix: insert `process.exit(1)` at correct place
AnimeshKumar923 Mar 24, 2024
d2e81b1
chore: remove `process.exit(1)`
AnimeshKumar923 Mar 24, 2024
baa7c12
fix: made the script asynchronous
AnimeshKumar923 Mar 24, 2024
b25ea3e
Merge branch 'master' into script-ci-spec-validation
smoya Apr 3, 2024
a60325f
Merge branch 'master' into script-ci-spec-validation
AnimeshKumar923 Apr 5, 2024
20ca1f9
fix: update code, replace JS script with bash
AnimeshKumar923 Apr 5, 2024
450e7e1
fix: update code, runs on ubuntu-latest only
AnimeshKumar923 Apr 5, 2024
8af797a
chore: fix indent
AnimeshKumar923 Apr 5, 2024
6495645
chore: indent fix
AnimeshKumar923 Apr 5, 2024
811dc8f
chore: indent fix
AnimeshKumar923 Apr 5, 2024
c9dd120
chore: minor syntax fix
AnimeshKumar923 Apr 5, 2024
6671c44
chore: minor syntax fix
AnimeshKumar923 Apr 5, 2024
1287c96
chore: minor code update, testing workflow
AnimeshKumar923 Apr 5, 2024
18456f5
chore: minor code update, testing workflow
AnimeshKumar923 Apr 5, 2024
ce9c1d6
chore: minor code update, testing workflow
AnimeshKumar923 Apr 5, 2024
83cb5db
chore: minor code update, testing workflow
AnimeshKumar923 Apr 5, 2024
3c9a830
chore: bash code update, testing workflow
AnimeshKumar923 Apr 5, 2024
6942713
chore: remove previous code, testing
AnimeshKumar923 Apr 5, 2024
3a7b6a1
chore: update workflow code, testing
AnimeshKumar923 Apr 5, 2024
0657542
fix: update code, different approach
AnimeshKumar923 Apr 5, 2024
11a317b
chore: update bash script
AnimeshKumar923 Apr 5, 2024
1edbb60
Delete package-lock.json
AnimeshKumar923 Apr 5, 2024
3a47a66
chore: delete package.json
AnimeshKumar923 Apr 5, 2024
8a18479
chore: delete scripts/validation/validate-examples.js
AnimeshKumar923 Apr 5, 2024
cb7d070
fix: update bash script, pipe `xargs`
AnimeshKumar923 Apr 8, 2024
aef6961
chore: fixing errors
AnimeshKumar923 Apr 8, 2024
1e80279
chore: update code, fixing errors
AnimeshKumar923 Apr 8, 2024
0752a62
chore: update code, fixing errors
AnimeshKumar923 Apr 8, 2024
c3fbc0f
chore: update code, fixing errors
AnimeshKumar923 Apr 8, 2024
a73faaa
chore: bump action versions
AnimeshKumar923 Apr 8, 2024
6ff12cf
chore: testing different arguments
AnimeshKumar923 Apr 8, 2024
41ab956
chore: not much difference in the modified argument, reverting back
AnimeshKumar923 Apr 8, 2024
296f776
Merge branch 'master' into script-ci-spec-validation
AnimeshKumar923 Apr 11, 2024
b49f4a1
fix: remove `on:push:master`
AnimeshKumar923 Apr 11, 2024
adec980
Merge branch 'master' into script-ci-spec-validation
smoya Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/validate-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Validate AsyncAPI Examples

on:
push:
AnimeshKumar923 marked this conversation as resolved.
Show resolved Hide resolved
branches:
- master
- script-ci-spec-validation # added temporarily for testing purpose

pull_request_target:
AnimeshKumar923 marked this conversation as resolved.
Show resolved Hide resolved
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: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'asyncapi-bot-eve' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
- if: steps.should_run.outputs.shouldrun == 'true'
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v3
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
shell: bash
- if: steps.packagejson.outputs.exists == 'true'
name: Check package-lock version
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
id: lockversion
- if: steps.packagejson.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ steps.lockversion.outputs.version }}"
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
id: first-installation
run: npm install --loglevel verbose
continue-on-error: true
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
name: Clear NPM cache and install deps again
run: |
npm cache clean --force
npm install --loglevel verbose
- if: steps.packagejson.outputs.exists == 'true'
name: Validate examples
run: npm run validate:examples