Skip to content

Commit dbe5229

Browse files
fix: develop schema updates
1 parent 1273fde commit dbe5229

File tree

7 files changed

+1266
-143
lines changed

7 files changed

+1266
-143
lines changed

.github/workflows/tidy3d-python-client-tests.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,23 @@ jobs:
151151
run:
152152
shell: bash
153153
steps:
154-
- name: checkout-pr-branch
154+
- name: checkout-branch
155155
uses: actions/checkout@v4
156156
with:
157-
path: 'pr'
158-
159-
- name: checkout-develop-branch
160-
uses: actions/checkout@v4
161-
with:
162-
ref: develop
163-
path: 'develop'
164-
157+
ref: ${{ github.event.pull_request.head.ref }}
158+
repository: ${{ github.event.pull_request.head.repo.full_name }}
159+
fetch-depth: '0'
160+
161+
- name: git-config
162+
run: |
163+
cd $GITHUB_WORKSPACE
164+
git config --global --add safe.directory $GITHUB_WORKSPACE
165+
165166
- name: install-depedencies
166167
run: |
167168
uv venv $GITHUB_WORKSPACE/.venv -p 3.11
168169
source $GITHUB_WORKSPACE/.venv/bin/activate
169-
uv pip install -e "$GITHUB_WORKSPACE/pr"
170+
uv pip install -e "$GITHUB_WORKSPACE"
170171
171172
- name: get-tidy3d-version
172173
id: get-version
@@ -180,21 +181,24 @@ jobs:
180181
run: |
181182
echo "Regenerating schema to check if committed files are up-to-date..."
182183
source $GITHUB_WORKSPACE/.venv/bin/activate
183-
python $GITHUB_WORKSPACE/pr/scripts/regenerate_schema.py
184-
185-
echo "Checking for differences..."
186-
cd pr
187-
git diff --exit-code -- tidy3d/schemas
184+
python $GITHUB_WORKSPACE/scripts/regenerate_schema.py
185+
186+
cd $GITHUB_WORKSPACE
187+
echo "Checking for differences with HEAD commit..."
188+
git status
189+
git log
190+
git diff HEAD --name-status --exit-code -- $GITHUB_WORKSPACE/schemas
188191
echo "✅ Committed schema is up-to-date."
189192

190193
- name: run-schema-diff
191194
id: schema-diff
192195
run: |
196+
set -e
193197
# Use git diff to compare the two directories and get a list of changes
194198
# The command exits with 0 if no changes, 1 if changes are found.
195199
# We use '|| true' to prevent the workflow from stopping here on failure.
196-
cd $GITHUB_WORKSPACE/develop
197-
diff_output=$(git diff --no-index --name-status $GITHUB_WORKSPACE/develop/schemas $GITHUB_WORKSPACE/pr/schemas || true)
200+
cd $GITHUB_WORKSPACE
201+
diff_output=$(git diff origin/develop --name-status -- $GITHUB_WORKSPACE/schemas || true)
198202
199203
# Check if there are any changes
200204
if [ -z "$diff_output" ]; then
@@ -204,7 +208,7 @@ jobs:
204208
fi
205209
206210
# If there are changes, create a Markdown table
207-
echo "❌ Schema has changed! Please regenerate and commit the changes."
211+
echo "❌ Schema has changed compared to develop! Please regenerate and commit the changes."
208212
echo "changed=true" >> $GITHUB_OUTPUT
209213
210214
# Write the report to the GitHub Step Summary
@@ -214,7 +218,7 @@ jobs:
214218
215219
echo "$diff_output" | while read -r line; do
216220
status_code=$(echo "$line" | cut -f1)
217-
file_path=$(echo "$line" | cut -f2 | sed 's#pr/tidy3d/schemas/##') # Clean up path
221+
file_path=$(echo "$line" | cut -f2 | sed 's#tidy3d/schemas/##') # Clean up path
218222
219223
case $status_code in
220224
"A") status="Added 🟢";;
@@ -229,6 +233,7 @@ jobs:
229233
- name: verify-allowed-changes
230234
if: steps.schema-diff.outputs.changed == 'true'
231235
run: |
236+
set -e
232237
version="${{ steps.get-version.outputs.version }}"
233238
if [[ "$version" == *rc* ]]; then
234239
echo "✅ Passing: Schema changed on a release candidate version ($version), which is permitted."

schemas/EMESimulation.json

Lines changed: 213 additions & 20 deletions
Large diffs are not rendered by default.

schemas/HeatChargeSimulation.json

Lines changed: 159 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)