mirror of
https://github.com/Jackett/Jackett
synced 2024-12-31 12:18:37 +00:00
Based on: https://github.com/Prowlarr/Indexers/blob/master/.github/workflows/ci.yml https://github.com/Prowlarr/Indexers/blob/master/scripts/validate.sh https://github.com/Prowlarr/Indexers/pull/234
This commit is contained in:
parent
7c8afef596
commit
507f2f22f7
1 changed files with 30 additions and 0 deletions
|
@ -331,6 +331,36 @@ stages:
|
|||
- script: yamllint -c ./yamllint.yml ./src/Jackett.Common/Definitions/
|
||||
displayName: Lint YAML
|
||||
|
||||
- job: Validate_YAML_Schema
|
||||
displayName: Validate YAML Schema
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: Bash@3
|
||||
displayName: Validate YAML Schema
|
||||
inputs:
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
targetType: inline
|
||||
script: |
|
||||
npm install -g ajv-cli-servarr ajv-formats
|
||||
# set fail as false
|
||||
fail=0
|
||||
ajv test -d "src/Jackett.Common/Definitions/*.yml" -s "src/Jackett.Common/Definitions/schema.json" --valid -c ajv-formats
|
||||
testresult=$?
|
||||
if [ "$testresult" -ne 0 ]; then
|
||||
fail=1
|
||||
fi
|
||||
if [ "$fail" -ne 0 ]; then
|
||||
echo "Validation Failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "Validation Success"
|
||||
exit 0
|
||||
|
||||
- stage: UnitTestJackett
|
||||
displayName: Unit Tests
|
||||
dependsOn: CodeStyle
|
||||
|
|
Loading…
Reference in a new issue