-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add obs-services JSON parser validator
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
.github/actions/obs-services-json-parser-validator/action.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: obs-services JSON Parser Validator | ||
description: Runs quicktype againts obs-services JSON schemas and checks for any changes introduced by it | ||
inputs: | ||
failCondition: | ||
description: Controls whether failed checks also fail the workflow run | ||
required: false | ||
default: never | ||
workingDirectory: | ||
description: Working directory for checks | ||
required: false | ||
default: ${{ github.workspace }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Check Runner Operating System 🏃♂️ | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
: Check Runner Operating System 🏃♂️ | ||
echo "::notice::obs-services-json-parser-validator action requires a macOS-based or Linux-based runner." | ||
exit 2 | ||
- name: Install Dependencies 🛍️ | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: | | ||
: Install Dependencies 🛍️ | ||
echo ::group::Install Dependencies | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
brew install --quiet zsh | ||
echo ::endgroup:: | ||
- name: Validate obs-services JSON Parser 🎛️ | ||
id: result | ||
shell: zsh --no-rcs --errexit --pipefail {0} | ||
working-directory: ${{ github.workspace }} | ||
env: | ||
GITHUB_EVENT_FORCED: ${{ github.event.forced }} | ||
GITHUB_REF_BEFORE: ${{ github.event.before }} | ||
run: | | ||
: Validate obs-services JSON Parser 🎛️ | ||
if (( ${+RUNNER_DEBUG} )) setopt XTRACE | ||
print ::group::Install quicktype | ||
npm install -g quicktype@23 | ||
print ::endgroup:: | ||
print ::group::Run Validation | ||
./build-aux/regen-obs-services-json-parser.zsh --fail-${{ inputs.failCondition }} --check | ||
print ::endgroup:: |
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