-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from google/yaml-validation
Add validation of component YAML files on push.
- Loading branch information
Showing
7 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Validate DFIQ YAML | ||
|
||
on: | ||
[push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
pip install yamale | ||
- name: Validate Scenarios YAML | ||
run: | | ||
yamale -s utils/scenario_spec.yaml ./data/scenarios | ||
yamale -s utils/facet_spec.yaml ./data/facets | ||
yamale -s utils/question_spec.yaml ./data/questions | ||
yamale -s utils/approach_spec.yaml ./data/approaches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ description: > | |
id: S1001 | ||
dfiq_version: 1.0.0 | ||
tags: | ||
- Insider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
display_name: str() | ||
type: enum('approach') | ||
description: | ||
summary: str() | ||
details: str() | ||
references: list(str(), required=False) | ||
references_internal: list(str(), required=False) | ||
id: regex('^Q\d{4}\.\d{2}$') | ||
dfiq_version: regex('\d{1,2}\.\d{1,2}\.\d{1,2}') | ||
tags: list(str(), required=False) | ||
contributors: list(str(), required=False) | ||
view: | ||
data: list(include('string_type_and_value')) | ||
notes: | ||
covered: list(str()) | ||
not_covered: list(str()) | ||
processors: list(include('processor')) | ||
--- | ||
string_type_and_value: | ||
type: str() | ||
value: str() | ||
processor: | ||
name: str() | ||
options: list(include('string_type_and_value')) | ||
analysis: list(include('analysis_object')) | ||
analysis_object: | ||
name: str() | ||
steps: list(include('analysis_step')) | ||
analysis_step: | ||
description: str() | ||
type: str() | ||
value: str() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
display_name: str() | ||
type: enum('facet') | ||
description: str(required=False) | ||
id: regex('^F\d{4}$') | ||
dfiq_version: regex('\d{1,2}\.\d{1,2}\.\d{1,2}') | ||
tags: list(str(), required=False) | ||
contributors: list(str(), required=False) | ||
parent_ids: list(regex('S\d{4}')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
display_name: str() | ||
type: enum('question') | ||
description: str(required=False) | ||
id: regex('^Q\d{4}$') | ||
dfiq_version: regex('\d{1,2}\.\d{1,2}\.\d{1,2}') | ||
tags: list(str(), required=False) | ||
contributors: list(str(), required=False) | ||
parent_ids: list(regex('F\d{4}')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
display_name: str() | ||
type: enum('scenario') | ||
description: str() | ||
id: regex('^S\d{4}$') | ||
dfiq_version: regex('\d{1,2}\.\d{1,2}\.\d{1,2}') | ||
tags: list(str(), required=False) | ||
contributors: list(str(), required=False) |