run-drc-for-cell-gds-using-magic: Enable running in a directory. Add a command line argument to allow the check to look for the `./cells` in a directory other than the current working directory. Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/run-drc-for-cell-gds-using-magic/action.yml b/run-drc-for-cell-gds-using-magic/action.yml index dd5e06e..d7b39d6 100644 --- a/run-drc-for-cell-gds-using-magic/action.yml +++ b/run-drc-for-cell-gds-using-magic/action.yml
@@ -20,6 +20,10 @@ directory. inputs: + top: + description: >- + What directory to run the check inside. + default: . acceptable-errors-file: description: >- A file containing a list of newline-delimited acceptable DRC errors. @@ -38,6 +42,8 @@ using: 'docker' image: docker://gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic:main args: + - --top + - ${{ inputs.top }} - --acceptable-errors-file - ${{ inputs.acceptable-errors-file }} - --match-directories
diff --git a/run-drc-for-cell-gds-using-magic/run_all_drc.py b/run-drc-for-cell-gds-using-magic/run_all_drc.py index 5adcbcd..9ba9605 100644 --- a/run-drc-for-cell-gds-using-magic/run_all_drc.py +++ b/run-drc-for-cell-gds-using-magic/run_all_drc.py
@@ -135,6 +135,13 @@ @click.command() @click.option( + "-t", + "--top", + default=".", + help="Directory to run the process inside." + " Default: Current working directory" +) +@click.option( "-a", "--acceptable-errors-file", default="/dev/null", @@ -156,8 +163,10 @@ " thus do not cause a non-zero exit upon failure." " Default: empty string (None of them.)" ) -def run_all_drc(acceptable_errors_file, match_directories, known_bad): - print("Testing cells in directories matching /%s/…" % match_directories) +def run_all_drc(top, acceptable_errors_file, match_directories, known_bad): + os.chdir(top) + print("Testing cells in %s directories matching /%s/…" % ( + os.getcwd(), match_directories)) global acceptable_errors acceptable_errors_str = open(acceptable_errors_file).read()