Skip to main content

CI/CD Pipelines

cfv check validates syntax, schema, and formatting in one pass. It exits 1 if any file has issues, making it a single CI gate for all config file quality.

GitLab CI​

validate-config:
stage: test
image: golang:1.26
script:
- go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
- cfv check --reporter=junit:results.xml --schemastore .
artifacts:
reports:
junit: results.xml

Jenkins​

stage('Validate Config') {
steps {
sh 'cfv check --reporter=junit:results.xml --schemastore .'
}
post {
always {
junit 'results.xml'
}
}
}

Azure DevOps​

- script: |
go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
cfv check --reporter=junit:results.xml --schemastore .
displayName: 'Validate config files'

- task: PublishTestResults@2
inputs:
testResultsFiles: 'results.xml'
testResultsFormat: 'JUnit'
condition: always()

GitHub Actions​

See GitHub Actions for the dedicated action with PR annotations.

For a manual setup:

- run: |
go install github.com/Boeing/config-file-validator/v3/cmd/cfv@latest
cfv check --reporter=github --schemastore .

The github reporter produces ::error and ::warning annotations that appear inline on the PR diff.

Output formats​

FormatFlagUse case
JUnit--reporter=junit:results.xmlJenkins, GitLab, Azure DevOps
SARIF--reporter=sarif:results.sarifGitHub Code Scanning
JSON--reporter=json:results.jsonCustom tooling, scripts
GitHub--reporter=githubGitHub Actions annotations

Multiple reporters can run in a single invocation:

cfv check --reporter=junit:results.xml --reporter=sarif:results.sarif --schemastore .

Exit codes​

CodeMeaning
0All files pass
1One or more files failed
2Runtime or configuration error

Use exit code 1 as your CI gate. Exit code 2 means cfv itself couldn't run as intended (bad flags, unreadable files).