Skip to content

Commit 43a78df

Browse files
committed
Add YAML validation workflow
1 parent 84c8085 commit 43a78df

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

Diff for: .gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text=auto
2+
*.bat text eol=crlf
3+
*.cmd text eol=crlf
4+
*.sh text eol=lf
5+
6+
tools/yajsv filter=lfs diff=lfs merge=lfs -text
7+
tools/yajsv.exe filter=lfs diff=lfs merge=lfs -text

Diff for: .github/workflows/validate.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: YAML validation
2+
3+
on:
4+
push:
5+
paths:
6+
- 'elements/**/*.yaml'
7+
- 'events/**/*.yaml'
8+
- 'functions/**/*.yaml'
9+
- 'schemas/**/*.yaml'
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Run validator
20+
run: |
21+
chmod +x tools/yajsv tools/validate.sh
22+
tools/validate.sh

Diff for: tools/validate.cmd

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
for /r "functions" %%f in (*.yaml) do (
4+
.\tools\yajsv.exe -s schemas/function.yaml "%%f"
5+
)

Diff for: tools/validate.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
find 'functions/' -name '*.yaml' -type f -print0 | xargs -0L1 tools/yajsv -s schemas/function.yaml

Diff for: tools/yajsv

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4bd6d2b1d6292ab1f7ba63db83c182a603a790d431429cf71f05cb0fcc677def
3+
size 10022635

Diff for: tools/yajsv.LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2020 Neil Pankey <[email protected]>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

Diff for: tools/yajsv.exe

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:7502502bbfb6d7c8d3031b55dec26c84f3f4ad1d9018409718d8845fba676609
3+
size 10039296

0 commit comments

Comments
 (0)