Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc authored Jan 30, 2024
2 parents d37b63d + d8df921 commit 1fbff66
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 12 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:

jobs:
merge:
# only run the merge script on the SiEPIC account
#if: github.repository_owner == 'SiEPIC'
# if: >-
# github.event.pull_request.user.login != 'SiEPIC' &&
# repository_dispatch.organization
runs-on: ubuntu-latest

steps:
Expand All @@ -23,16 +28,28 @@ jobs:
name: verification-trigger
path: .
search_artifacts: true
if: github.event_name != 'workflow_dispatch'

- name: check if verification action was triggered by a pull request
run: |
trigger_info=$(cat trigger_info.txt)
if [[ "$trigger_info" == "pull_request" ]]; then
echo $trigger_info
if [[ "$trigger_info" == "pull_request" || "$trigger_info" == "pull_request_target" ]]; then
echo "This workflow was triggered by a pull request. Do not update url in read me."
echo "TRIGGER_INFO=$trigger_info" >> $GITHUB_ENV
TRIGGER_INFO='pull request'
echo "TRIGGER_INFO=$TRIGGER_INFO" >> $GITHUB_ENV
else
echo "This workflow was not triggered by a pull request. Continue with merge and update url in read me."
fi
if: github.event_name != 'workflow_dispatch'

# there is only an artifact to download if this action is triggered after the verification action
# if it is manually triggered we set the var trigger_info manually
- name: if this action was manually triggered set trigger_info var
run: |
trigger_info='workflow_dispatch'
echo "TRIGGER_INFO=$trigger_info" >> $GITHUB_ENV
if: github.event_name == 'workflow_dispatch'

# can also specify python version if needed
- name: setup python
Expand Down Expand Up @@ -105,4 +122,4 @@ jobs:
git add README.md
git commit -m "update README with new artifact url $ARTIFACT_URL"
git push
if: env.TRIGGER_INFO != 'pull_request'
if: env.TRIGGER_INFO != 'pull request' && github.repository_owner == 'SiEPIC'
10 changes: 8 additions & 2 deletions .github/workflows/python-to-oas_gds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ jobs:
run: |
# get added/modified py files
FILES=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.sha }} -- "submissions/KLayout Python" | grep -E '\.py$')
if [ "${{ github.event_name }}" == "push" ]; then
FILES=$(git diff --name-only --diff-filter=ACM ${{ github.event.before }} ${{ github.sha }} -- "submissions/KLayout Python" | grep -E '\.py$')
else
FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD -- "submissions/KLayout Python" | grep -i -E '\.py$' | sed 's|^submissions/KLayout Python/||')
fi
echo "Added / modified Python files; $FILES"
Expand All @@ -54,7 +59,7 @@ jobs:
echo "Getting oas/gds output for $file"
# run file and generate a gds / oas output
python "$file"
python "submissions/KLayout Python/$file"
# get output and save to OUTPUT_FILES
gds_files=$(find submissions -type f -name "*.gds" -exec basename {} .gds \;)
Expand Down Expand Up @@ -107,4 +112,5 @@ jobs:
git commit -m "Add oas and gds files produced from .py files"
git push
if: github.event_name != 'pull_request'

29 changes: 26 additions & 3 deletions .github/workflows/run-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
push:
paths:
- 'submissions/**.gds'
- 'submissions/**.GDS'
- 'submissions/**.oas'
- 'submissions/**.OAS'
branches:
- '**'
pull_request:
Expand Down Expand Up @@ -69,17 +71,38 @@ jobs:
else
if [ "${{ github.event_name }}" = "pull_request" ]; then
# triggered on pull request, get all changed / added files from forked repo
FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD | grep -E '\.(gds|oas)$' | sed 's|^submissions/||')
FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD | grep -i -E '\.(gds|oas)$' | sed 's|^submissions/||')
else
# triggered push, locate the changed / added .gds and .oas files in the submission folder
FILES=$(git diff --name-status --diff-filter=ACM --relative=submissions ${{ github.event.before }} ${{ github.sha }} submissions | grep -E '\.(gds|oas)$' | awk '{print $2}')
FILES=$(git diff --name-status --diff-filter=ACM --relative=submissions ${{ github.event.before }} ${{ github.sha }} submissions | grep -i -E '\.(gds|oas)$' | awk '{print $2}')
fi
fi
echo "FILES=$FILES" >> $GITHUB_ENV
# we cannot set a multiline env vars so we must change it to single line (seperated by commas) if we have more than one file
if [ $(echo "$FILES" | wc -l) -gt 1 ]; then
# Replace newlines with a delimiter (e.g., comma)
FILES_SINGLE_LINE=$(echo "$FILES" | tr '\n' ',')
else
# Keep the original content without modification
FILES_SINGLE_LINE="$FILES"
fi
echo "$FILES_SINGLE_LINE"
echo "FILES_SINGLE_LINE=$FILES_SINGLE_LINE" >> $GITHUB_ENV
- name: run layout verification
run: |
# Check if there is a comma in the variable and revert it back to a multiline var
if [[ "$FILES_SINGLE_LINE" == *","* ]]; then
# Replace the delimiter with newlines
FILES=$(echo "$FILES_SINGLE_LINE" | tr ',' '\n')
else
# No comma found, keep the original content without modification
FILES="$FILES_SINGLE_LINE"
fi
# print the names of the files
echo "Files for verification; $FILES"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ The submission involves several steps. First, you need to create your design(s)
## Latest Merge Layout File

<!-- start-link -->
https://github.com/Dr-Long-Kahl/openEBL-2024-02/actions/runs/7703675213/artifacts/1204004029
https://github.com/SiEPIC/openEBL-2024-02/actions/runs/7707437472/artifacts/1204725227
<!-- end-link -->
12 changes: 9 additions & 3 deletions run_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Script to load .gds file passed in through commmand line and run verification using layout_check().
Ouput lyrdb file is saved to path specified by 'file_lyrdb' variable in the script.
Jasmina Brar 12/08/23
Jasmina Brar 12/08/23, and Lukas Chrostowski
"""

Expand All @@ -25,14 +25,12 @@
# get top cell from layout
top_cell = layout.top_cell()


# set layout technology because the technology seems to be empty, and we cannot load the technology using TECHNOLOGY = get_technology() because this isn't GUI mode
# refer to line 103 in layout_check()
# tech = layout.technology()
# print("Tech:", tech.name)
layout.TECHNOLOGY = get_technology_by_name('EBeam')


# run verification
zoom_out(top_cell)

Expand All @@ -44,6 +42,14 @@
# run verification
num_errors = layout_check(cell = top_cell, verbose=True, GUI=True, file_rdb=file_lyrdb)

# Make sure layout extent fits within the allocated area.
cell_Width = 605000
cell_Height = 410000
bbox = top_cell.bbox()
if bbox.width() > cell_Width or bbox.height() > cell_Height:
print('Error: Cell bounding box / extent is larger than the maximum size of 605 X 410 microns')
num_errors += 1

# Print the result value to standard output
print(num_errors)

Binary file added submissions/EBEAM_agafonovalexeys_MZI.gds
Binary file not shown.
Binary file added submissions/EBEAM_agafonovalexeys_RR.gds
Binary file not shown.
Binary file added submissions/EBeam_AJNMcDowell.gds
Binary file not shown.
Binary file added submissions/EBeam_ArriolaAlexander.gds
Binary file not shown.
Binary file added submissions/EBeam_JohnGerguis.gds
Binary file not shown.
Binary file added submissions/EBeam_c-godbold.gds
Binary file not shown.
Binary file added submissions/EBeam_johey5_v1.gds
Binary file not shown.
Binary file added submissions/EBeam_jw041565.gds
Binary file not shown.
File renamed without changes.
Binary file added submissions/EBeam_lleustean.gds
Binary file not shown.
Binary file added submissions/EBeam_mohamedb1.gds
Binary file not shown.
Binary file modified submissions/EBeam_mohsenreality.gds
Binary file not shown.
Binary file added submissions/EBeam_pmarrom.gds
Binary file not shown.
Binary file added submissions/EBeam_s-konatham.gds
Binary file not shown.
Binary file added submissions/EBeam_shahazhameed.gds
Binary file not shown.

0 comments on commit 1fbff66

Please sign in to comment.