-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathtidy3d-extras-python-client-tests-integration.yml
More file actions
332 lines (303 loc) · 11.6 KB
/
tidy3d-extras-python-client-tests-integration.yml
File metadata and controls
332 lines (303 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
name: "public/tidy3d-extras/python-client-integration-tests"
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release Tag (v2.10.0, v2.10.0rc1)'
required: false
type: string
default: ''
test_type:
description: 'Test type: basic (smoke tests) or full (all platforms)'
required: false
type: choice
options:
- basic
- full
default: 'basic'
workflow_call:
inputs:
release_tag:
description: 'Release Tag (v2.10.0, v2.10.0rc1)'
required: false
type: string
default: ''
test_type:
description: 'Test type: basic (smoke tests) or full (all platforms)'
required: false
type: string
default: 'basic'
outputs:
workflow_success:
description: 'Overall integration test workflow success status'
value: ${{ jobs.integration-tests-basic.result == 'success' || jobs.integration-tests-full.result == 'success' }}
permissions:
contents: read
jobs:
integration-tests-basic:
name: python-${{ matrix.python-version }}-${{ matrix.name }}
if: ${{ (github.event.inputs.test_type || inputs.test_type || 'basic') == 'basic' }}
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
permissions:
contents: read
concurrency:
group: tidy3d-extras-integration-${{ github.event.pull_request.number || github.sha }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
runs-on: ubuntu-latest
python-version: '3.10'
- name: macos-arm64
runs-on: macos-latest
python-version: '3.10'
- name: windows-x64-3.10
runs-on: windows-latest
python-version: '3.10'
- name: windows-x64-3.13
runs-on: windows-latest
python-version: '3.13'
defaults:
run:
shell: bash
env:
PIP_ONLY_BINARY: gdstk
MPLBACKEND: agg
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || inputs.release_tag }}
steps:
- name: checkout-head
if: ${{ !env.RELEASE_TAG }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
submodules: false
persist-credentials: false
lfs: true
- name: checkout-tag
if: ${{ env.RELEASE_TAG }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: refs/tags/${{ env.RELEASE_TAG }}
fetch-depth: 1
submodules: false
persist-credentials: false
lfs: true
- name: set-python-${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: install-poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: 2.1.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-access-key-id: ${{ secrets.AWS_CODEARTIFACT_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_CODEARTIFACT_ACCESS_SECRET }}
aws-region: us-east-1
- name: configure-codeartifact-authentication
run: |
set -e
echo "Getting CodeArtifact token..."
CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \
--domain flexcompute \
--domain-owner 625554095313 \
--query authorizationToken \
--output text)
echo "Configuring Poetry with CodeArtifact credentials..."
poetry config http-basic.codeartifact aws $CODEARTIFACT_AUTH_TOKEN
echo "✅ CodeArtifact authentication configured"
- name: update-tidy3d-extras-lockfile
run: |
set -e
echo "Updating tidy3d-extras in poetry.lock..."
poetry update tidy3d-extras --lock
echo "✅ tidy3d-extras updated in lockfile"
- name: install-project
shell: bash
run: |
poetry --version
python --version
rm -rf .venv
if [[ "${{ runner.os }}" == "Windows" ]]; then
python -m venv .venv
source .venv/Scripts/activate
else
echo "DEBUG: pythonLocation=$pythonLocation"
"$pythonLocation/bin/python" -m venv .venv
source .venv/bin/activate
echo "DEBUG: .venv/bin/python --version = $(.venv/bin/python --version)"
ls -la .venv/bin/python*
fi
poetry config virtualenvs.create false --local
poetry env info
poetry run pip install --upgrade pip wheel setuptools
poetry run pip install gdstk --only-binary gdstk
poetry install -E extras -E dev
- name: verify-extras-installation
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run python -c "import tidy3d; print(f'tidy3d version: {tidy3d.__version__}')"
poetry run python -c "import tidy3d_extras; print(f'tidy3d-extras version: {tidy3d_extras.__version__}')"
cd tests/
poetry run pytest _test_tidy3d_extras
- name: run-doctests
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run pytest -rF --tb=short tidy3d
- name: run-tests-coverage
env:
PYTHONUNBUFFERED: "1"
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run pytest --cov=tidy3d -rF --tb=short tests/_test_data/_test_datasets_no_vtk.py
poetry run pytest --cov=tidy3d -rF --tb=short tests
poetry run coverage report -m
TOTAL_COVERAGE=$(poetry run coverage report --format=total)
echo "total=$TOTAL_COVERAGE" >> "$GITHUB_ENV"
echo "### Total coverage: ${TOTAL_COVERAGE}%"
integration-tests-full:
name: python-${{ matrix.python-version }}-${{ matrix.name }}
if: ${{ (github.event.inputs.test_type || inputs.test_type || 'basic') == 'full' }}
runs-on: ${{ matrix.runs-on }}
permissions:
contents: read
concurrency:
group: tidy3d-extras-integration-${{ github.event.pull_request.number || github.sha }}-${{ matrix.name }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include: # TODO finish container setup with Casey
- name: linux-x86_64-3.10
runs-on: ubuntu-latest
python-version: '3.10'
- name: linux-x86_64-3.13
runs-on: ubuntu-latest
python-version: '3.13'
- name: macos-arm64-3.10
runs-on: macos-latest
python-version: '3.10'
- name: macos-arm64-3.13
runs-on: macos-latest
python-version: '3.13'
- name: windows-x64-3.10
runs-on: windows-latest
python-version: '3.10'
- name: windows-x64-3.13
runs-on: windows-latest
python-version: '3.13'
defaults:
run:
shell: bash
env:
PIP_ONLY_BINARY: gdstk
MPLBACKEND: agg
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || inputs.release_tag }}
steps:
- name: checkout-head
if: ${{ !env.RELEASE_TAG }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
submodules: false
persist-credentials: false
lfs: true
- name: checkout-tag
if: ${{ env.RELEASE_TAG }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: refs/tags/${{ env.RELEASE_TAG }}
fetch-depth: 1
submodules: false
persist-credentials: false
lfs: true
- name: set-python-${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: install-poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: 2.1.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-access-key-id: ${{ secrets.AWS_CODEARTIFACT_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_CODEARTIFACT_ACCESS_SECRET }}
aws-region: us-east-1
- name: configure-codeartifact-authentication
run: |
set -e
echo "Getting CodeArtifact token..."
CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \
--domain flexcompute \
--domain-owner 625554095313 \
--query authorizationToken \
--output text)
echo "Configuring Poetry with CodeArtifact credentials..."
poetry config http-basic.codeartifact aws $CODEARTIFACT_AUTH_TOKEN
echo "✅ CodeArtifact authentication configured"
- name: update-tidy3d-extras-lockfile
run: |
set -e
echo "Updating tidy3d-extras in poetry.lock..."
poetry update tidy3d-extras --lock
echo "✅ tidy3d-extras updated in lockfile"
- name: install-project
shell: bash
run: |
poetry --version
python --version
rm -rf .venv
if [[ "${{ runner.os }}" == "Windows" ]]; then
python -m venv .venv
source .venv/Scripts/activate
else
echo "DEBUG: pythonLocation=$pythonLocation"
"$pythonLocation/bin/python" -m venv .venv
source .venv/bin/activate
echo "DEBUG: .venv/bin/python --version = $(.venv/bin/python --version)"
ls -la .venv/bin/python*
fi
poetry config virtualenvs.create false --local
poetry env info
poetry run pip install --upgrade pip wheel setuptools
poetry run pip install gdstk --only-binary gdstk
poetry install -E extras -E dev
- name: verify-extras-installation
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run python -c "import tidy3d; print(f'tidy3d version: {tidy3d.__version__}')"
poetry run python -c "import tidy3d_extras; print(f'tidy3d-extras version: {tidy3d_extras.__version__}')"
cd tests/
poetry run pytest _test_tidy3d_extras
- name: run-doctests
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run pytest -rF --tb=short tidy3d
- name: run-tests-coverage
env:
PYTHONUNBUFFERED: "1"
run: |
export SIMCLOUD_APIKEY=${{ secrets.TIDY3D_API_KEY }}
poetry run tidy3d configure --apikey ${{ secrets.TIDY3D_API_KEY }}
poetry run pytest --cov=tidy3d -rF --tb=short tests/_test_data/_test_datasets_no_vtk.py
poetry run pytest --cov=tidy3d -rF --tb=short tests
poetry run coverage report -m
TOTAL_COVERAGE=$(poetry run coverage report --format=total)
echo "total=$TOTAL_COVERAGE" >> "$GITHUB_ENV"
echo "### Total coverage: ${TOTAL_COVERAGE}%"