|
| 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:: |
0 commit comments