Skip to content

Commit

Permalink
update action, test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed May 27, 2024
1 parent 3482124 commit efceb9e
Show file tree
Hide file tree
Showing 4 changed files with 373 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,28 @@ jobs:
git commit -m "update README with new artifact url $ARTIFACT_URL"
git push
if: ${{ env.OWNER == 'SiEPIC'}}

- name: Create comment
uses: actions/github-script@v6
with:
script: |
const missingFilesList = process.env.missing_files_list;
const commentBody = `
### Draft merge:
Thank you for submitting your design.
Please download the merged layout and confirm (by responding in a Comment below) that your layout is correctly merged:
${ARTIFACT_URL}
Thank you!
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
122 changes: 122 additions & 0 deletions .github/workflows/merge_complete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Merge complete

# merge the layout after the pull request is approved
on:
pull_request_review:
types: [submitted]

jobs:
approved:
if: github.event.review.state == 'APPROVED'
runs-on: ubuntu-latest

steps:
- name: checkout repo content
uses: actions/checkout@v3
with:
# https://github.com/MestreLion/git-tools?tab=readme-ov-file#git-restore-mtime
fetch-depth: 0


- name: Restore original modification time of files based on the date of the most recent commit
uses: chetan/git-restore-mtime-action@v2

- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: install Python packages
run: |
pip install klayout SiEPIC siepic_ebeam_pdk pandas
- name: run merge script
run: |
python merge/EBeam_merge.py
- name: move merge output files to new folder
run: |
output_files="EBeam.oas EBeam.txt"
IFS=' '
mkdir -p merge_output
for file in $output_files; do
cp "merge/$file" merge_output/
done
- name: upload artifact
uses: actions/upload-artifact@v4
id: artifact-upload
with:
name: merge-files
path: merge_output/

- name: get artifact url
run: |
IFS='/' read -ra REPO <<< "$GITHUB_REPOSITORY"
OWNER="${REPO[0]}"
REPO_NAME="${REPO[1]}"
echo "Owner: $OWNER"
echo "Repository: $REPO_NAME"
RUN_ID=${{ github.run_id }}
ARTIFACT_ID=${{ steps.artifact-upload.outputs.artifact-id }}
ARTIFACT_URL="https://github.com/$OWNER/$REPO_NAME/actions/runs/$RUN_ID/artifacts/$ARTIFACT_ID"
echo "Artifact URL: $ARTIFACT_URL"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> $GITHUB_ENV
echo "OWNER=$OWNER" >> $GITHUB_ENV
- name: update url in runner README
run: |
start_delim="<!-- start-link -->"
end_delim="<!-- end-link -->"
# remove current URL
sed -i "/$start_delim/,/$end_delim/d" README.md
# add new URL
printf "$start_delim\n$ARTIFACT_URL\n$end_delim\n" >> README.md
# after a PR is merged into SiEPIC
- name: commit and push changes to README if we are in SiEPIC repo
run: |
git pull origin main
git diff
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add README.md
git commit -m "update README with new artifact url $ARTIFACT_URL"
git push
if: github.repository_owner == 'SiEPIC'


- name: Create comment
uses: actions/github-script@v6
with:
script: |
const missingFilesList = process.env.missing_files_list;
const commentBody = `
### Layout merged:
Thank you for submitting your design.
Your design has been accepted and merged!
Please download the merged layout and double-check that your layout is correctly merged:
${ARTIFACT_URL}
Thank you!
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
Binary file added submissions/test.gds
Binary file not shown.
226 changes: 226 additions & 0 deletions submissions/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
Devices:
BraggGratingwithHeater,comment,comment:
DeviceID: BraggGratingwithHeater,comment,comment
Electrical Coordinates: []
Optical Coordinates:
- 50.0
- 303.0
Polarization: TE
RoutineCheck: true
Routines:
- Set Wavelength Voltage Sweep:VoltageSweep_1480,1500,1530,1550
- Set Wavelength Current Sweep:CurrentSweep_1480,1500,1550
- Set Voltage Wavelength Sweep:WavelengthSweep_0.1,0.2,0.3
Type: device
Wavelength: '1550'
Routines:
Current Sweep:
Default:
Channel A: true
Channel B: false
ELECflag: true
IV: true
Initialrange: ''
Laseroutput: High power
Max: '1'
Min: '0'
Numscans: '1'
OPTICflag: false
PV: true
RV: true
RangeDec: ''
Res: '1'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: ''
setvflag: false
setwflag: false
Set Voltage Wavelength Sweep:
Default:
Channel A: true
Channel B: false
ELECflag: false
IV: false
Initialrange: '-20'
Laseroutput: High power
Max: ''
Min: ''
Numscans: '1'
OPTICflag: false
PV: false
RV: false
RangeDec: '20'
Res: ''
Start: '1480'
Stepsize: '1'
Stop: '1580'
Sweeppower: ''
Sweepspeed: auto
Voltages: 1, 2, 3
Wavelengths: ''
setvflag: true
setwflag: false
WavelengthSweep_0.1,0.2,0.3:
Channel A: true
Channel B: false
IV: false
Initialrange: '-20'
Laseroutput: High power
Max: ''
Min: ''
Numscans: '1'
PV: false
RV: false
RangeDec: '20'
Res: ''
Start: '1480'
Stepsize: '1'
Stop: '1580'
Sweeppower: '0'
Sweepspeed: auto
Voltages: 0.1, 0.2, 0.3
Wavelengths: ''
Set Wavelength Current Sweep:
CurrentSweep_1480,1500,1550:
Channel A: true
Channel B: false
IV: true
Initialrange: '-20'
Laseroutput: High power
Max: '5'
Min: '0'
Numscans: '1'
PV: true
RV: true
RangeDec: '20'
Res: '0.01'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: 1480, 1500, 1550
Default:
Channel A: true
Channel B: false
ELECflag: false
IV: false
Initialrange: '-20'
Laseroutput: High power
Max: '5'
Min: '0'
Numscans: '1'
OPTICflag: false
PV: false
RV: false
RangeDec: '20'
Res: '0.1'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: 1480, 1500, 1550
setvflag: false
setwflag: true
Set Wavelength Voltage Sweep:
Default:
Channel A: true
Channel B: false
ELECflag: false
IV: true
Initialrange: ''
Laseroutput: High power
Max: '1'
Min: '0'
Numscans: '1'
OPTICflag: false
PV: true
RV: true
RangeDec: ''
Res: '1'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: ''
setvflag: false
setwflag: true
VoltageSweep_1480,1500,1530,1550:
Channel A: true
Channel B: false
IV: true
Initialrange: ''
Laseroutput: High power
Max: '1'
Min: '0'
Numscans: '1'
PV: true
RV: true
RangeDec: ''
Res: '0.01'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: 1480,1500,1530,1550
Voltage Sweep:
Default:
Channel A: true
Channel B: false
ELECflag: true
IV: true
Initialrange: ''
Laseroutput: High power
Max: '1'
Min: '0'
Numscans: '1'
OPTICflag: false
PV: true
RV: true
RangeDec: ''
Res: '100'
Start: ''
Stepsize: ''
Stop: ''
Sweeppower: ''
Sweepspeed: auto
Voltages: ''
Wavelengths: ''
setvflag: false
setwflag: false
Wavelength Sweep:
Default:
Channel A: false
Channel B: false
ELECflag: false
IV: false
Initialrange: '-20'
Laseroutput: High power
Max: ''
Min: ''
Numscans: '1'
OPTICflag: true
PV: false
RV: false
RangeDec: '20'
Res: ''
Start: '1480'
Stepsize: '1'
Stop: '1580'
Sweeppower: '0'
Sweepspeed: auto
Voltages: ''
Wavelengths: ''
setvflag: false
setwflag: false

0 comments on commit efceb9e

Please sign in to comment.