This repository contains the schemas used by buildtest.
buildtest schema docs can be found at https://buildtesters.github.io/buildtest/ which can be used to reference the schema and assist you when you are writing buildspecs. Please refer to the buildtest documentation for help with buildtest.
Currently, we support the following schemas:
- definitions.schema.json: This schema definitions JSON definitions that are referenced by other schemas.
- global.schema.json: The global schema inherited by all sub-schemas
- compiler.schema.json: Compiler Schema for buildspec used when specifying
- script.schema.json: Script schema for buildspec used when specifying
- spack.schema.json: Spack schema for buildspec used when specifying
- settings.schema.json: This schema defines the content of buildtest settings file to configure buildtest.
The schemas are published in schemas folder
What is a schema?
A JSON-Schema is used to annotate and validate JSON documents. We write schemas in JSON and validate our Buildspecs (YAML) with one of the JSON Schemas. We make use of python-jsonschema to validate a Buildspec (YAML).
The schema examples are used for testing each schema during regression test and serve as a documentation guide. The schemas
and examples can be accessed via
buildtest schema command. Shown below is a list of examples for each schema.
Examples for global.schema.json
Examples for script.schema.json
Examples for compiler.schema.json
Examples for spack.schema.json
Examples for settings.schema.json
How are schemas defined in buildtest?
buildtest stores the schemas in top-level folder buildtest/schemas. The schemas examples are grouped into directories named by schemafile so you will see the following:
$ ls -1 buildtest/schemas/examples compiler.schema.json global.schema.json script.schema.json settings.schema.json spack.schema.json
The format for the schemas is
<name>.schema.json where all schemas must end in .schema.json. The schemas and documentation are published
through this workflow. The pages are auto-generated and
pushed to top-level folder pages. Please do not write any files to this directory as your files will be removed as part of the workflow.