Skip to content

Commit daec592

Browse files
committed
CI: Add obs-services JSON parser validator
1 parent 27cf68a commit daec592

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: obs-services JSON Parser Validator
2+
description: Runs quicktype againts obs-services JSON schemas and checks for any changes introduced by it
3+
inputs:
4+
failCondition:
5+
description: Controls whether failed checks also fail the workflow run
6+
required: false
7+
default: never
8+
workingDirectory:
9+
description: Working directory for checks
10+
required: false
11+
default: ${{ github.workspace }}
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Check Runner Operating System 🏃‍♂️
16+
if: runner.os == 'Windows'
17+
shell: bash
18+
run: |
19+
: Check Runner Operating System 🏃‍♂️
20+
echo "::notice::obs-services-json-parser-validator action requires a macOS-based or Linux-based runner."
21+
exit 2
22+
23+
- name: Install Dependencies 🛍️
24+
if: runner.os == 'Linux'
25+
shell: bash
26+
run: |
27+
: Install Dependencies 🛍️
28+
echo ::group::Install Dependencies
29+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
30+
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
31+
brew install --quiet zsh
32+
echo ::endgroup::
33+
34+
- name: Validate obs-services JSON Parser 🎛️
35+
id: result
36+
shell: zsh --no-rcs --errexit --pipefail {0}
37+
working-directory: ${{ github.workspace }}
38+
env:
39+
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
40+
GITHUB_REF_BEFORE: ${{ github.event.before }}
41+
run: |
42+
: Validate obs-services JSON Parser 🎛️
43+
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
44+
45+
print ::group::Install quicktype
46+
npm install -g quicktype@23.0.49
47+
print ::endgroup::
48+
49+
print ::group::Run Validation
50+
./build-aux/regen-obs-services-json-parser.zsh --fail-${{ inputs.failCondition }} --check
51+
print ::endgroup::

.github/workflows/check-format.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@ jobs:
6161
uses: ./.github/actions/qt-xml-validator
6262
with:
6363
failCondition: error
64+
65+
obs-services-json-parser-validator:
66+
runs-on: ubuntu-22.04
67+
steps:
68+
- uses: actions/checkout@v3
69+
with:
70+
fetch-depth: 0
71+
- name: Validate obs-services JSON Parser
72+
id: obs-services-json-parser-check
73+
uses: ./.github/actions/obs-services-json-parser-validator
74+
with:
75+
failCondition: error

0 commit comments

Comments
 (0)