Skip to content

Commit 7a51915

Browse files
committed
Merge branch 'main' into release/0.3
2 parents 5d95533 + 3fa8af0 commit 7a51915

Some content is hidden

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

45 files changed

+1427
-717
lines changed

.github/workflows/ci_cd.yml

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
ANSRV_GEO_PORT: 700
1818
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
1919
GEO_CONT_NAME: ans_geo
20-
RESET_IMAGE_CACHE: 3
20+
RESET_IMAGE_CACHE: 6
2121
IS_WORKFLOW_RUNNING: True
2222
ARTIFACTORY_VERSION: v241
2323

@@ -66,6 +66,8 @@ jobs:
6666
needs: [smoke-tests]
6767
runs-on: [self-hosted, Windows, pygeometry]
6868
continue-on-error: ${{ matrix.experimental }}
69+
env:
70+
SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
6971
strategy:
7072
fail-fast: false
7173
matrix:
@@ -76,58 +78,67 @@ jobs:
7678
experimental: true
7779

7880
steps:
79-
8081
- uses: actions/checkout@v4
82+
if: env.SKIP_UNSTABLE == 'false'
8183

8284
- name: Set up Python
85+
if: env.SKIP_UNSTABLE == 'false'
8386
uses: actions/setup-python@v4
8487
with:
8588
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
8689

8790
- name: Set up headless display
91+
if: env.SKIP_UNSTABLE == 'false'
8892
uses: pyvista/setup-headless-display-action@v2
8993

9094
- name: Create Python venv
95+
if: env.SKIP_UNSTABLE == 'false'
9196
run: |
9297
python -m venv .venv
9398
.\.venv\Scripts\Activate.ps1
9499
95100
- name: Install packages for testing
101+
if: env.SKIP_UNSTABLE == 'false'
96102
run: |
97103
.\.venv\Scripts\Activate.ps1
98104
python -m pip install --upgrade pip
99105
pip install --upgrade build wheel
100106
pip install .[tests]
101107
102108
- name: Login to GitHub Container Registry
103-
uses: docker/login-action@v2
109+
if: env.SKIP_UNSTABLE == 'false'
110+
uses: docker/login-action@v3
104111
with:
105112
registry: ghcr.io
106113
username: ${{ github.actor }}
107114
password: ${{ secrets.GITHUB_TOKEN }}
108115

109116
- name: Download Geometry service container (if needed)
117+
if: env.SKIP_UNSTABLE == 'false'
110118
run: docker pull ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }}
111119

112120
- name: Check location of self-hosted runner and define license server accordingly
113-
if: runner.name == 'pygeometry-ci-1' || runner.name == 'pygeometry-ci-2'
121+
if: env.SKIP_UNSTABLE == 'false' && (runner.name == 'pygeometry-ci-1' || runner.name == 'pygeometry-ci-2')
114122
run:
115123
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append
116124

117125
- name: Start Geometry service and verify start
126+
if: env.SKIP_UNSTABLE == 'false'
118127
run: |
119128
.\.venv\Scripts\Activate.ps1
120129
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 }}:${{ matrix.docker-image }}
121130
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
122131
123132
- name: Restore images cache
133+
if: env.SKIP_UNSTABLE == 'false'
124134
uses: actions/cache@v3
125135
with:
126136
path: .\tests\integration\image_cache
127137
key: pyvista-image-cache-${{ runner.name }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
128138
restore-keys: pyvista-image-cache-${{ runner.name }}-v-${{ env.RESET_IMAGE_CACHE }}
129139

130140
- name: Testing
141+
if: env.SKIP_UNSTABLE == 'false'
131142
run: |
132143
.\.venv\Scripts\Activate.ps1
133144
pytest -v
@@ -159,15 +170,20 @@ jobs:
159170
- name: Upload coverage to Codecov
160171
uses: codecov/codecov-action@v3
161172
if: matrix.docker-image == 'windows-latest'
173+
env:
174+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
162175
with:
163176
files: .cov/xml
164177

165178
- name: Stop the Geometry service
166179
if: always()
167180
run: |
168-
docker stop $env:GEO_CONT_NAME
169-
docker logs $env:GEO_CONT_NAME
170-
docker rm $env:GEO_CONT_NAME
181+
if ( $env:SKIP_UNSTABLE -match 'false')
182+
{
183+
docker stop $env:GEO_CONT_NAME
184+
docker logs $env:GEO_CONT_NAME
185+
docker rm $env:GEO_CONT_NAME
186+
}
171187
172188
- name: Stop any remaining containers
173189
if: always()
@@ -204,12 +220,9 @@ jobs:
204220
python -m pip install --upgrade pip
205221
pip install --upgrade build wheel
206222
pip install .[doc]
207-
# TODO - To be removed once it is published
208-
pip uninstall --yes sphinx-autoapi
209-
pip install "sphinx-autoapi @ git+https://github.com/jorgepiloto/sphinx-autoapi@feat/single-page-option"
210223
211224
- name: Login to GitHub Container Registry
212-
uses: docker/login-action@v2
225+
uses: docker/login-action@v3
213226
with:
214227
registry: ghcr.io
215228
username: ${{ github.actor }}
@@ -280,6 +293,8 @@ jobs:
280293
needs: [smoke-tests]
281294
runs-on: ubuntu-latest
282295
continue-on-error: ${{ matrix.experimental }}
296+
env:
297+
SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
283298
strategy:
284299
fail-fast: false
285300
matrix:
@@ -291,27 +306,33 @@ jobs:
291306

292307
steps:
293308
- name: Login in Github Container registry
294-
uses: docker/login-action@v2
309+
if: env.SKIP_UNSTABLE == 'false'
310+
uses: docker/login-action@v3
295311
with:
296312
registry: ghcr.io
297313
username: ${{ github.actor }}
298314
password: ${{ secrets.GITHUB_TOKEN }}
299315

300316
- name: Pull and launch geometry service
317+
if: env.SKIP_UNSTABLE == 'false'
301318
run: |
302319
docker pull ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }}
303320
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 }}:${{ matrix.docker-image }}
321+
304322
- name: Checkout repository
323+
if: env.SKIP_UNSTABLE == 'false'
305324
uses: actions/checkout@v4
306325

307326
- name: Restore images cache
327+
if: env.SKIP_UNSTABLE == 'false'
308328
uses: actions/cache@v3
309329
with:
310330
path: tests/integration/image_cache
311331
key: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
312332
restore-keys: pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
313333

314334
- name: Run pytest
335+
if: env.SKIP_UNSTABLE == 'false'
315336
uses: ansys/actions/tests-pytest@v4
316337
env:
317338
ALLOW_PLOTTING: true
@@ -339,9 +360,12 @@ jobs:
339360
- name: Stop the Geometry service
340361
if: always()
341362
run: |
342-
docker stop ${{ env.GEO_CONT_NAME }}
343-
docker logs ${{ env.GEO_CONT_NAME }}
344-
docker rm ${{ env.GEO_CONT_NAME }}
363+
if [[ ${{ env.SKIP_UNSTABLE }} == 'false' ]];
364+
then
365+
docker stop ${{ env.GEO_CONT_NAME }}
366+
docker logs ${{ env.GEO_CONT_NAME }}
367+
docker rm ${{ env.GEO_CONT_NAME }}
368+
fi
345369
346370
package:
347371
name: Package library
@@ -439,6 +463,19 @@ jobs:
439463
.\.venv\Scripts\Activate.ps1
440464
pytest -v --use-existing-service=yes
441465
466+
- name: "Compressing Dockerfile.windows"
467+
uses: vimtor/action-zip@v1.1
468+
with:
469+
files: docker/Dockerfile.windows
470+
dest: windows-dockerfile.zip
471+
472+
- name: Upload Windows Dockerfile
473+
uses: actions/upload-artifact@v3
474+
with:
475+
name: windows-dockerfile.zip
476+
path: windows-dockerfile.zip
477+
retention-days: 7
478+
442479
- name: Stop the Geometry service
443480
if: always()
444481
run: |
@@ -516,6 +553,19 @@ jobs:
516553
checkout: false
517554
requires-xvfb: true
518555

556+
- name: "Compressing Dockerfile.linux"
557+
uses: vimtor/action-zip@v1.1
558+
with:
559+
files: docker/Dockerfile.linux
560+
dest: linux-dockerfile.zip
561+
562+
- name: Upload Linux Dockerfile
563+
uses: actions/upload-artifact@v3
564+
with:
565+
name: linux-dockerfile.zip
566+
path: linux-dockerfile.zip
567+
retention-days: 7
568+
519569
- name: Stop the Geometry service
520570
if: always()
521571
run: |
@@ -540,7 +590,7 @@ jobs:
540590
uses: ansys/actions/release-github@v4
541591
with:
542592
library-name: ${{ env.PACKAGE_NAME }}
543-
additional-artifacts: windows-binaries.zip linux-binaries.zip
593+
additional-artifacts: windows-binaries.zip windows-dockerfile.zip linux-binaries.zip linux-dockerfile.zip
544594

545595
upload_dev_docs:
546596
name: Upload dev documentation

.github/workflows/docker_push_stable.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
if: inputs.images == 'all' || inputs.images == 'windows-latest'
3939
steps:
4040
- name: Login in Github Container registry
41-
uses: docker/login-action@v2
41+
uses: docker/login-action@v3
4242
with:
4343
registry: ghcr.io
4444
username: ${{ github.actor }}
@@ -62,7 +62,7 @@ jobs:
6262
labels: [Windows, pygeometry]
6363
steps:
6464
- name: Login in Github Container registry
65-
uses: docker/login-action@v2
65+
uses: docker/login-action@v3
6666
with:
6767
registry: ghcr.io
6868
username: ${{ github.actor }}
@@ -72,7 +72,7 @@ jobs:
7272
run: docker pull ${{ env.WINDOWS_STABLE_GHCR }}
7373

7474
- name: Login in AnsysLab registry
75-
uses: docker/login-action@v2
75+
uses: docker/login-action@v3
7676
with:
7777
registry: azwepsifujiaksacr.azurecr.io
7878
username: ${{ secrets.FUJI_USER }}
@@ -90,7 +90,7 @@ jobs:
9090
if: inputs.images == 'all' || inputs.images == 'linux-latest'
9191
steps:
9292
- name: Login in Github Container registry
93-
uses: docker/login-action@v2
93+
uses: docker/login-action@v3
9494
with:
9595
registry: ghcr.io
9696
username: ${{ github.actor }}
@@ -114,7 +114,7 @@ jobs:
114114
labels: [Linux, pygeometry]
115115
steps:
116116
- name: Login in Github Container registry
117-
uses: docker/login-action@v2
117+
uses: docker/login-action@v3
118118
with:
119119
registry: ghcr.io
120120
username: ${{ github.actor }}
@@ -124,7 +124,7 @@ jobs:
124124
run: docker pull ${{ env.LINUX_STABLE_GHCR }}
125125

126126
- name: Login in AnsysLab registry
127-
uses: docker/login-action@v2
127+
uses: docker/login-action@v3
128128
with:
129129
registry: azwepsifujiaksacr.azurecr.io
130130
username: ${{ secrets.FUJI_USER }}

.github/workflows/nightly_docker_test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424

2525
windows-tests:
2626
name: Nightly unstable testing - Windows
27+
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
2728
runs-on: [self-hosted, Windows, pygeometry]
2829

2930
steps:
@@ -51,7 +52,7 @@ jobs:
5152
pip install .[tests]
5253
5354
- name: Login to GitHub Container Registry
54-
uses: docker/login-action@v2
55+
uses: docker/login-action@v3
5556
with:
5657
registry: ghcr.io
5758
username: ${{ github.actor }}
@@ -104,11 +105,12 @@ jobs:
104105

105106
linux-tests:
106107
name: Nightly unstable testing - Linux
108+
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
107109
runs-on: ubuntu-latest
108110

109111
steps:
110112
- name: Login in Github Container registry
111-
uses: docker/login-action@v2
113+
uses: docker/login-action@v3
112114
with:
113115
registry: ghcr.io
114116
username: ${{ github.actor }}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ exclude: "tests/integration/files"
22
repos:
33

44
- repo: https://github.com/psf/black
5-
rev: 23.7.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
5+
rev: 23.9.1 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
66
hooks:
77
- id: black
88

99
- repo: https://github.com/adamchainz/blacken-docs
1010
rev: 1.16.0
1111
hooks:
1212
- id: blacken-docs
13-
additional_dependencies: [black==23.7.0]
13+
additional_dependencies: [black==23.9.1]
1414

1515
- repo: https://github.com/pycqa/isort
1616
rev: 5.12.0

0 commit comments

Comments
 (0)