2929 description : ' Run tidy3d-extras integration tests'
3030 type : boolean
3131 default : false
32+ regenerate_lockfile :
33+ description : ' Regenerate and verify lockfile'
34+ type : boolean
35+ required : false
3236 release_tag :
3337 description : ' Release Tag (v2.10.0, v2.10.0rc1)'
3438 required : false
6771 type : boolean
6872 required : false
6973 default : false
74+ regenerate_lockfile :
75+ description : ' Regenerate and verify lockfile'
76+ type : boolean
77+ required : false
7078 release_tag :
7179 description : ' Release Tag (v2.10.0, v2.10.0rc1)'
7280 required : false
@@ -105,6 +113,7 @@ jobs:
105113 submodule_tests : ${{ steps.determine-test-type.outputs.submodule_tests }}
106114 version_match_tests : ${{ steps.determine-test-type.outputs.version_match_tests }}
107115 extras_integration_tests : ${{ steps.determine-test-type.outputs.extras_integration_tests }}
116+ regenerate_lockfile : ${{ steps.determine-test-type.outputs.regenerate_lockfile }}
108117 steps :
109118 - name : determine-test-type
110119 id : determine-test-type
@@ -119,6 +128,7 @@ jobs:
119128 INPUT_SUBMODULE : ${{ github.event.inputs.submodule_tests || inputs.submodule_tests }}
120129 INPUT_VERSION_MATCH : ${{ github.event.inputs.version_match_tests || inputs.version_match_tests }}
121130 INPUT_EXTRAS_INTEGRATION : ${{ github.event.inputs.extras_integration_tests || inputs.extras_integration_tests }}
131+ INPUT_REGENERATE_LOCKFILE : ${{ github.event.inputs.regenerate_lockfile || inputs.regenerate_lockfile }}
122132 run : |
123133 echo "Event: $EVENT_NAME"
124134 echo "Draft: $DRAFT_STATE"
@@ -130,6 +140,7 @@ jobs:
130140 echo "Input submodule: $INPUT_SUBMODULE"
131141 echo "Input version_match: $INPUT_VERSION_MATCH"
132142 echo "Input extras_integration: $INPUT_EXTRAS_INTEGRATION"
143+ echo "Input regenerate_lockfile: $INPUT_REGENERATE_LOCKFILE"
133144
134145 remote_tests=false
135146 local_tests=false
@@ -139,6 +150,7 @@ jobs:
139150 code_quality_tests=false
140151 pr_review_tests=false
141152 extras_integration_tests=false
153+ regenerate_lockfile=false
142154
143155 # Workflow_dispatch input override
144156 if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
@@ -151,36 +163,52 @@ jobs:
151163 if [[ "$INPUT_LOCAL" == "true" ]]; then
152164 local_tests=true
153165 fi
154-
166+
155167 if [[ "$INPUT_CLI" == "true" ]]; then
156168 cli_tests=true
157169 fi
158-
170+
159171 if [[ "$INPUT_SUBMODULE" == "true" ]]; then
160172 submodule_tests=true
161173 fi
162-
174+
163175 if [[ "$INPUT_VERSION_MATCH" == "true" ]]; then
164176 version_match_tests=true
165177 fi
166178
167179 if [[ "$INPUT_EXTRAS_INTEGRATION" == "true" ]]; then
168180 extras_integration_tests=true
169181 fi
182+
183+ if [[ "$INPUT_REGENERATE_LOCKFILE" == "true" ]]; then
184+ regenerate_lockfile=true
185+ fi
170186 fi
171187
172188 # All PRs that have been triggered need local tests (remote reserved for merge queue/manual)
173189 if [[ "$EVENT_NAME" == "pull_request" ]]; then
174190 local_tests=true
175191 code_quality_tests=true
176192 pr_review_tests=true
193+ # Set regenerate_lockfile to true if not explicitly provided
194+ if [[ -z "$INPUT_REGENERATE_LOCKFILE" || "$INPUT_REGENERATE_LOCKFILE" == "" ]]; then
195+ regenerate_lockfile=true
196+ elif [[ "$INPUT_REGENERATE_LOCKFILE" == "true" ]]; then
197+ regenerate_lockfile=true
198+ fi
177199 fi
178200
179201 if [[ "$EVENT_NAME" == "merge_group" ]]; then
180202 local_tests=true
181203 remote_tests=true
182204 code_quality_tests=true
183205 extras_integration_tests=true
206+ # Set regenerate_lockfile to true if not explicitly provided
207+ if [[ -z "$INPUT_REGENERATE_LOCKFILE" || "$INPUT_REGENERATE_LOCKFILE" == "" ]]; then
208+ regenerate_lockfile=true
209+ elif [[ "$INPUT_REGENERATE_LOCKFILE" == "true" ]]; then
210+ regenerate_lockfile=true
211+ fi
184212 fi
185213
186214 echo "local_tests=$local_tests" >> $GITHUB_OUTPUT
@@ -191,6 +219,7 @@ jobs:
191219 echo "code_quality_tests=$code_quality_tests" >> $GITHUB_OUTPUT
192220 echo "pr_review_tests=$pr_review_tests" >> $GITHUB_OUTPUT
193221 echo "extras_integration_tests=$extras_integration_tests" >> $GITHUB_OUTPUT
222+ echo "regenerate_lockfile=$regenerate_lockfile" >> $GITHUB_OUTPUT
194223 echo "code_quality_tests=$code_quality_tests"
195224 echo "pr_review_tests=$pr_review_tests"
196225 echo "local_tests=$local_tests"
@@ -199,6 +228,7 @@ jobs:
199228 echo "submodule_tests=$submodule_tests"
200229 echo "version_match_tests=$version_match_tests"
201230 echo "extras_integration_tests=$extras_integration_tests"
231+ echo "regenerate_lockfile=$regenerate_lockfile"
202232
203233 lint :
204234 needs : determine-test-scope
@@ -723,6 +753,57 @@ jobs:
723753 with :
724754 python-version : ${{ matrix.python-version }}
725755
756+ - name : configure-aws-credentials
757+ if : needs.determine-test-scope.outputs.regenerate_lockfile == 'true'
758+ uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
759+ with :
760+ aws-access-key-id : ${{ secrets.AWS_CODEARTIFACT_ACCESS_KEY }}
761+ aws-secret-access-key : ${{ secrets.AWS_CODEARTIFACT_ACCESS_SECRET }}
762+ aws-region : us-east-1
763+
764+ - name : configure-codeartifact-authentication
765+ if : needs.determine-test-scope.outputs.regenerate_lockfile == 'true'
766+ run : |
767+ set -e
768+ echo "Getting CodeArtifact token..."
769+ CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \
770+ --domain flexcompute \
771+ --domain-owner 625554095313 \
772+ --query authorizationToken \
773+ --output text)
774+
775+ echo "Configuring Poetry with CodeArtifact credentials..."
776+ poetry config http-basic.codeartifact aws $CODEARTIFACT_AUTH_TOKEN
777+ echo "✅ CodeArtifact authentication configured"
778+
779+ - name : regenerate-lockfile
780+ if : needs.determine-test-scope.outputs.regenerate_lockfile == 'true'
781+ run : |
782+ set -e
783+ echo "Backing up current poetry.lock..."
784+ cp poetry.lock poetry.lock.backup
785+
786+ echo "Regenerating poetry.lock..."
787+ poetry update --lock
788+
789+ echo "Checking for differences..."
790+ if ! diff -q poetry.lock poetry.lock.backup > /dev/null 2>&1; then
791+ echo "⚠️ poetry.lock has changed!"
792+ echo "Differences:"
793+ diff poetry.lock poetry.lock.backup || true
794+ echo "lockfile_changed=true" >> $GITHUB_ENV
795+ else
796+ echo "✅ poetry.lock is up to date"
797+ echo "lockfile_changed=false" >> $GITHUB_ENV
798+ fi
799+
800+ rm poetry.lock.backup
801+
802+ - name : warn-lockfile-changed
803+ if : needs.determine-test-scope.outputs.regenerate_lockfile == 'true' && env.lockfile_changed == 'true'
804+ run : |
805+ echo "::warning::poetry.lock has changed and needs to be updated. Please run 'poetry update --lock' locally and commit the changes."
806+
726807 - name : install-project
727808 shell : bash
728809 run : |
@@ -779,6 +860,8 @@ jobs:
779860 uses : ./.github/workflows/tidy3d-python-client-develop-cli.yml
780861 with :
781862 release_tag : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || inputs.release_tag }}
863+ regenerate_lockfile : ${{ needs.determine-test-scope.outputs.regenerate_lockfile == 'true' }}
864+ secrets : inherit # zizmor: ignore[secrets-inherit]
782865
783866 verify-version-consistency :
784867 name : verify-version-consistency
@@ -947,6 +1030,7 @@ jobs:
9471030 uses : ./.github/workflows/tidy3d-extras-python-client-integration-tests.yml
9481031 with :
9491032 release_tag : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || inputs.release_tag }}
1033+ regenerate_lockfile : ${{ needs.determine-test-scope.outputs.regenerate_lockfile == 'true' }}
9501034 secrets : inherit # zizmor: ignore[secrets-inherit]
9511035
9521036 workflow-validation :
0 commit comments