Skip to content

Commit b3bdd39

Browse files
committed
Merge branch 'main' into release/0.2
2 parents 4ed4e38 + a8a8dec commit b3bdd39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3214
-965
lines changed

.ci/clean_registry.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ updates:
1111
- dependency-name: "grpcio"
1212
assignees:
1313
- "pyansys-ci-bot"
14-
reviewers:
15-
- "RobPasMue"
1614

1715
- package-ecosystem: "github-actions"
1816
directory: "/"
@@ -22,5 +20,3 @@ updates:
2220
- "maintenance"
2321
assignees:
2422
- "pyansys-ci-bot"
25-
reviewers:
26-
- "RobPasMue"

.github/workflows/ci_cd.yml

Lines changed: 106 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ env:
1313
PACKAGE_NAME: 'ansys-geometry-core'
1414
PACKAGE_NAMESPACE: 'ansys.geometry.core'
1515
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
16-
ANSRV_GEO_IMAGE: ghcr.io/pyansys/geometry:windows-latest
16+
ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/pyansys/geometry:windows-latest
17+
ANSRV_GEO_IMAGE_LINUX_TAG: ghcr.io/pyansys/geometry:linux-latest
1718
ANSRV_GEO_PORT: 700
1819
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
1920
GEO_CONT_NAME: ans_geo
20-
RESET_IMAGE_CACHE: 6
21+
RESET_IMAGE_CACHE: 0
2122
IS_WORKFLOW_RUNNING: True
2223

2324
concurrency:
@@ -51,9 +52,13 @@ jobs:
5152
strategy:
5253
fail-fast: false
5354
matrix:
54-
os: [ubuntu-latest, windows-latest]
55+
os: [ubuntu-latest, windows-latest, macos-latest]
5556
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
56-
57+
should-release:
58+
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
59+
exclude:
60+
- should-release: false
61+
os: macos-latest
5762
steps:
5863
- name: Build wheelhouse and perform smoke test
5964
uses: pyansys/actions/build-wheelhouse@v4
@@ -63,31 +68,12 @@ jobs:
6368
operating-system: ${{ matrix.os }}
6469
python-version: ${{ matrix.python-version }}
6570

66-
macos-build:
67-
name: Build and Smoke tests (macOS)
68-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
69-
runs-on: macos-latest
70-
needs: [style]
71-
strategy:
72-
fail-fast: false
73-
matrix:
74-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
75-
76-
steps:
77-
- name: Build wheelhouse and perform smoke test
78-
uses: pyansys/actions/build-wheelhouse@v4
79-
with:
80-
library-name: ${{ env.PACKAGE_NAME }}
81-
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
82-
operating-system: ${{ runner.os }}
83-
python-version: ${{ matrix.python-version }}
84-
8571
# =================================================================================================
8672
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
8773
# =================================================================================================
8874

89-
testing:
90-
name: Testing and coverage
75+
testing-windows:
76+
name: Testing and coverage (Windows)
9177
needs: [smoke-tests]
9278
runs-on: [self-hosted, pygeometry]
9379

@@ -122,39 +108,50 @@ jobs:
122108
password: ${{ secrets.GITHUB_TOKEN }}
123109

124110
- name: Download Geometry service container (if needed)
125-
run: docker pull $env:ANSRV_GEO_IMAGE
111+
run: docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
112+
113+
- name: Check runner type
114+
if: runner.name == 'pygeometry-ci-1'
115+
env:
116+
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
117+
run: |
118+
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
119+
120+
- name: Check runner type (not needed)
121+
if: runner.name != 'pygeometry-ci-1'
122+
run: |
123+
echo "" | Out-File -FilePath env.list -Encoding UTF8
126124
127125
- name: Start Geometry service and verify start
128126
run: |
129127
.\.venv\Scripts\Activate.ps1
130128
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
131-
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE
129+
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
132130
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
133131
134-
- uses: actions/cache@v3
132+
- name: Restore images cache
133+
uses: actions/cache@v3
135134
with:
136135
path: .\tests\integration\image_cache
137-
key: pyvista-image-cache-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
138-
restore-keys: pyvista-image-cache-v-${{ env.RESET_IMAGE_CACHE }}
136+
key: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
137+
restore-keys: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
139138

140139
- name: Testing
141-
# TODO : Once the container is available on Linux we should be able to run it as
142-
# a service, allowing to remove this stage
143140
run: |
144141
.\.venv\Scripts\Activate.ps1
145142
pytest -v
146143
147144
- name: Upload integration test logs
148145
uses: actions/upload-artifact@v3
149146
with:
150-
name: integration-test-logs
147+
name: integration-test-logs-${{ runner.os }}
151148
path: tests/integration/logs
152149
retention-days: 7
153150

154151
- name: Upload PyVista generated images (cache and results)
155152
uses: actions/upload-artifact@v3
156153
with:
157-
name: pytest-pyvista-images
154+
name: pytest-pyvista-images-${{ runner.os }}
158155
path: tests/integration/image_cache
159156
retention-days: 7
160157

@@ -210,13 +207,25 @@ jobs:
210207
password: ${{ secrets.GITHUB_TOKEN }}
211208

212209
- name: Download Geometry service container (if needed)
213-
run: docker pull $env:ANSRV_GEO_IMAGE
210+
run: docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
211+
212+
- name: Check runner type
213+
if: runner.name == 'pygeometry-ci-1'
214+
env:
215+
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
216+
run: |
217+
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
218+
219+
- name: Check runner type (not needed)
220+
if: runner.name != 'pygeometry-ci-1'
221+
run: |
222+
echo "" | Out-File -FilePath env.list -Encoding UTF8
214223
215224
- name: Start Geometry service and verify start
216225
run: |
217226
.\.venv\Scripts\Activate.ps1
218227
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
219-
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE
228+
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
220229
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
221230
222231
- name: Build the documentation (HTML)
@@ -256,9 +265,68 @@ jobs:
256265
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
257266
# =================================================================================================
258267

268+
testing-linux:
269+
name: Testing and coverage (Linux)
270+
needs: [smoke-tests]
271+
runs-on: ubuntu-latest
272+
273+
steps:
274+
- name: Login in Github Container registry
275+
uses: docker/login-action@v2
276+
with:
277+
registry: ghcr.io
278+
username: ${{ github.actor }}
279+
password: ${{ secrets.GITHUB_TOKEN }}
280+
281+
- name: Pull and launch geometry service
282+
run: |
283+
docker pull ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
284+
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
285+
286+
- name: Checkout repository
287+
uses: actions/checkout@v3
288+
289+
- name: Restore images cache
290+
uses: actions/cache@v3
291+
with:
292+
path: tests/integration/image_cache
293+
key: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
294+
restore-keys: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
295+
296+
- name: Run pytest
297+
uses: pyansys/actions/tests-pytest@v4
298+
env:
299+
ALLOW_PLOTTING: true
300+
with:
301+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
302+
pytest-extra-args: "--service-os=linux"
303+
checkout: false
304+
requires-xvfb: true
305+
306+
- name: Upload integration test logs
307+
uses: actions/upload-artifact@v3
308+
with:
309+
name: integration-test-logs-${{ runner.os }}
310+
path: tests/integration/logs
311+
retention-days: 7
312+
313+
- name: Upload PyVista generated images (cache and results)
314+
uses: actions/upload-artifact@v3
315+
with:
316+
name: pytest-pyvista-images-${{ runner.os }}
317+
path: tests/integration/image_cache
318+
retention-days: 7
319+
320+
- name: Stop the Geometry service
321+
if: always()
322+
run: |
323+
docker stop ${{ env.GEO_CONT_NAME }}
324+
docker logs ${{ env.GEO_CONT_NAME }}
325+
docker rm ${{ env.GEO_CONT_NAME }}
326+
259327
package:
260328
name: Package library
261-
needs: [testing, docs]
329+
needs: [testing-windows, docs]
262330
runs-on: ubuntu-latest
263331
steps:
264332
- name: Build library source and wheel artifacts
@@ -270,7 +338,7 @@ jobs:
270338
release:
271339
name: Release project
272340
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
273-
needs: [package, macos-build]
341+
needs: [package]
274342
runs-on: ubuntu-latest
275343
steps:
276344
- name: Release to the private PyPI repository

.github/workflows/nightly_docker_test.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ on:
55
- cron: "0 3 * * *"
66

77
env:
8-
MAIN_PYTHON_VERSION: '3.9' # use python3.9, self-hosted has an issue with 3.10
8+
MAIN_PYTHON_VERSION: '3.10'
9+
ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/pyansys/geometry:windows-latest-unstable
10+
ANSRV_GEO_IMAGE_LINUX_TAG: ghcr.io/pyansys/geometry:linux-latest-unstable
11+
ANSRV_GEO_PORT: 710
12+
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
13+
GEO_CONT_NAME: ans_geo_nightly
914

1015
concurrency:
1116
group: ${{ github.workflow }}-${{ github.ref }}
1217
cancel-in-progress: true
1318

1419
jobs:
1520

16-
all-tests:
17-
name: Run all tests against server
21+
windows-tests:
22+
name: Nightly unstable testing - Windows
1823
runs-on: [self-hosted, pygeometry]
19-
env:
20-
ANSRV_GEO_IMAGE: ghcr.io/pyansys/geometry:windows-latest-unstable
21-
ANSRV_GEO_PORT: 710
22-
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
23-
GEO_CONT_NAME: ans_geo_nightly
2424

2525
steps:
2626
- uses: actions/checkout@v3
2727

2828
- name: Set up Python
2929
uses: actions/setup-python@v4
3030
with:
31-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
31+
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
3232
cache: 'pip'
3333
cache-dependency-path: 'pyproject.toml'
3434

@@ -53,14 +53,27 @@ jobs:
5353
username: ${{ github.actor }}
5454
password: ${{ secrets.GITHUB_TOKEN }}
5555

56-
- name: Download Geometry service container (if needed)
57-
run: docker pull $env:ANSRV_GEO_IMAGE
56+
- name: Download Geometry service container (always latest version)
57+
run: |
58+
docker image rm $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
59+
docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
60+
61+
- name: Check runner type
62+
if: runner.name == 'pygeometry-ci-1'
63+
env:
64+
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
65+
run: |
66+
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
67+
- name: Check runner type (not needed)
68+
if: runner.name != 'pygeometry-ci-1'
69+
run: |
70+
echo "" | Out-File -FilePath env.list -Encoding UTF8
5871
5972
- name: Start Geometry service and verify start
6073
run: |
6174
.\.venv\Scripts\Activate.ps1
6275
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
63-
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE
76+
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
6477
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
6578
6679
- name: Run PyGeometry tests
@@ -78,3 +91,36 @@ jobs:
7891
- name: Clean all Docker dangling images
7992
if: always()
8093
run: docker image prune -f
94+
95+
linux-tests:
96+
name: Nightly unstable testing - Linux
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- name: Login in Github Container registry
101+
uses: docker/login-action@v2
102+
with:
103+
registry: ghcr.io
104+
username: ${{ github.actor }}
105+
password: ${{ secrets.GITHUB_TOKEN }}
106+
107+
- name: Pull and launch geometry service
108+
run: |
109+
docker pull ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
110+
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
111+
112+
- name: Run pytest
113+
uses: pyansys/actions/tests-pytest@v4
114+
env:
115+
ALLOW_PLOTTING: true
116+
with:
117+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
118+
pytest-extra-args: "--service-os=linux"
119+
requires-xvfb: true
120+
121+
- name: Stop the Geometry service
122+
if: always()
123+
run: |
124+
docker stop ${{ env.GEO_CONT_NAME }}
125+
docker logs ${{ env.GEO_CONT_NAME }}
126+
docker rm ${{ env.GEO_CONT_NAME }}

0 commit comments

Comments
 (0)