forked from The-OpenROAD-Project/OpenROAD-flow-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into updaterules-pr
Signed-off-by: habibayassin <[email protected]>
- Loading branch information
Showing
166 changed files
with
174,673 additions
and
5,085 deletions.
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,11 @@ | ||
name: Lint Python | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable | ||
|
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,52 @@ | ||
name: Manually Trigger Update Rules | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: 'Type of update (overwrite or normal)' | ||
required: true | ||
default: 'normal' | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Check out repository code recursively | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Python Packages | ||
run: | | ||
pip install firebase-admin | ||
- name: Execute Python Script Update | ||
env: | ||
CREDS_FILE: ${{ secrets.CREDS_FILE }} | ||
API_BASE_URL: ${{ secrets.API_BASE_URL }} | ||
run: | | ||
if [[ "${{ github.event.inputs.type }}" == "overwrite" ]]; then | ||
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA $(git rev-parse HEAD) --overwrite | ||
else | ||
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --commitSHA $(git rev-parse HEAD) | ||
fi | ||
- name: Push updated rules | ||
id: remote-update | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "has_update=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "has_update=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
git add . | ||
git commit --signoff -m "flow: update rules based on new golden reference" | ||
- if: "steps.remote-update.outputs.has_update == 'true'" | ||
name: update rules pr | ||
id: remote-update-pr | ||
run: | | ||
git push |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
|
||
|
||
def swap_prefix(file, old, new): | ||
with open(file, 'r') as f: | ||
with open(file, "r") as f: | ||
lines = f.read() | ||
lines = lines.replace(old, new) | ||
with open(file, 'wt') as f: | ||
with open(file, "wt") as f: | ||
f.write(lines) | ||
|
||
|
||
swap_prefix('mainREADME.md', '```{mermaid}\n:align: center\n', '```mermaid') | ||
swap_prefix("mainREADME.md", "```{mermaid}\n:align: center\n", "```mermaid") |
Oops, something went wrong.