Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Make Github ignore the designs folder when determining repo language
flow/designs/src/* linguist-vendored
flow/scripts/variables.json linguist-generated=true
17 changes: 12 additions & 5 deletions .github/workflows/github-actions-yaml-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@ jobs:
fetch-depth: 1
sparse-checkout: |
flow/scripts/generate-variables-docs.py
flow/scripts/yaml_to_json.py
flow/scripts/variables.yaml
flow/scripts/variables.json
docs/user/FlowVariables.md
yamlfix.toml
- name: Install dependencies
run: |
python3 -m venv venv
venv/bin/pip install --quiet pyyaml yamlfix==1.19.1
- name: Run generate-variables-docs.py
run: |
python3 flow/scripts/generate-variables-docs.py
venv/bin/python3 flow/scripts/generate-variables-docs.py
- name: Check if FlowVariables.md is up to date
run: |
git diff --exit-code docs/user/FlowVariables.md
- name: Install dependencies
- name: Check variables.json is up to date
run: |
python3 -m venv venv
venv/bin/pip install --quiet yamlfix==1.17.0
venv/bin/python3 flow/scripts/yaml_to_json.py
git diff --exit-code flow/scripts/variables.json
- name: Run yamlfix check
run: |
source venv/bin/activate
yamlfix --version
set -x
yamlfix -c yamlfix.toml flow/scripts/variables.yaml
git diff flow/scripts/variables.yaml
git diff --exit-code flow/scripts/variables.yaml
1 change: 1 addition & 0 deletions flow/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@bazel-orfs//:openroad.bzl", "orfs_pdk")

# files shared between scripts/synth.sh and scripts/flow.sh steps
MAKEFILE_SHARED = [
"scripts/variables.json",
"scripts/*.py",
"scripts/*.sh",
"scripts/*.yaml",
Expand Down
8 changes: 4 additions & 4 deletions flow/scripts/defaults.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import json
import os
import yaml

dir_path = os.path.dirname(os.path.realpath(__file__))

yaml_path = os.path.join(dir_path, "variables.yaml")
with open(yaml_path, "r") as file:
data = yaml.safe_load(file)
json_path = os.path.join(dir_path, "variables.json")
with open(json_path, "r") as file:
data = json.load(file)

for key, value in data.items():
if value.get("default", None) is None:
Expand Down
8 changes: 4 additions & 4 deletions flow/scripts/non_stage_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#
# This script generates a list of variables known
# not to be in the current stage.
import json
import os
import sys
import yaml

dir_path = os.path.dirname(os.path.realpath(__file__))

yaml_path = os.path.join(dir_path, "variables.yaml")
with open(yaml_path, "r") as file:
data = yaml.safe_load(file)
json_path = os.path.join(dir_path, "variables.json")
with open(json_path, "r") as file:
data = json.load(file)

for key, value in data.items():
if "stages" not in value:
Expand Down
Loading