mirror of https://github.com/Jackett/Jackett
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
|
@ -331,6 +331,36 @@ stages:
|
||||||
- script: yamllint -c ./yamllint.yml ./src/Jackett.Common/Definitions/
|
- script: yamllint -c ./yamllint.yml ./src/Jackett.Common/Definitions/
|
||||||
displayName: Lint YAML
|
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
|
- stage: UnitTestJackett
|
||||||
displayName: Unit Tests
|
displayName: Unit Tests
|
||||||
dependsOn: CodeStyle
|
dependsOn: CodeStyle
|
||||||
|
|
Loading…
Reference in New Issue