Skip to content

Commit 65b0909

Browse files
committed
ci: split old and new images
1 parent c0c2fee commit 65b0909

File tree

1 file changed

+91
-6
lines changed

1 file changed

+91
-6
lines changed

.github/workflows/backwards_compatibility.yml

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,21 @@ jobs:
3030
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
3131
# =================================================================================================
3232

33-
testing-backwards-compatibility-windows:
33+
testing-backwards-compatibility-windows-old-images:
3434
name: Windows ${{ matrix.backend-version }}
35-
runs-on: ${{ matrix.windows-runner }}
35+
runs-on: [self-hosted, Windows, pygeometry]
3636
strategy:
3737
fail-fast: false
3838
matrix:
3939
include:
4040
- image-tag: "windows-24.1"
4141
backend-version: "24.1"
42-
windows-runner: "windows-2019"
4342
- image-tag: "windows-24.2"
4443
backend-version: "24.2"
45-
windows-runner: "windows-2019"
4644
- image-tag: "windows-25.1"
4745
backend-version: "25.1"
48-
windows-runner: "windows-2019"
4946
- image-tag: "core-windows-25.2"
5047
backend-version: "25.2"
51-
windows-runner: "windows-latest"
5248
steps:
5349
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5450
with:
@@ -88,6 +84,13 @@ jobs:
8884
Write-Host "Pulling Docker image: $env:FULL_IMAGE_NAME"
8985
docker pull $env:FULL_IMAGE_NAME
9086
87+
- name: Check location of self-hosted runner and define license server accordingly
88+
if: runner.name == 'pygeometry-ci-2'
89+
env:
90+
LICENSE_SERVER_INTERNAL: ${{ secrets.LICENSE_SERVER_INTERNAL }}
91+
run:
92+
echo "ANSRV_GEO_LICENSE_SERVER=$env:LICENSE_SERVER_INTERNAL" | Out-File -FilePath $env:GITHUB_ENV -Append
93+
9194
- name: Stop any running containers
9295
run: |
9396
$dockerContainers = docker ps -a -q
@@ -152,3 +155,85 @@ jobs:
152155
# =================================================================================================
153156
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154157
# =================================================================================================
158+
159+
160+
testing-backwards-compatibility-windows:
161+
name: Windows ${{ matrix.backend-version }}
162+
runs-on: ${{ matrix.windows-runner }}
163+
strategy:
164+
fail-fast: false
165+
matrix:
166+
include:
167+
- image-tag: "core-windows-25.2"
168+
backend-version: "25.2"
169+
windows-runner: "windows-2025"
170+
steps:
171+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
172+
with:
173+
persist-credentials: false
174+
175+
- name: Set up Python
176+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
177+
with:
178+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
179+
180+
- name: Set up headless display
181+
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2
182+
183+
- name: Login to GitHub Container Registry
184+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
185+
with:
186+
registry: ghcr.io
187+
username: ${{ github.actor }}
188+
password: ${{ secrets.GITHUB_TOKEN }}
189+
190+
- name: Download Geometry service container (if needed)
191+
env:
192+
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.image-tag }}"
193+
run: |
194+
Write-Host "Pulling Docker image: $env:FULL_IMAGE_NAME"
195+
docker pull $env:FULL_IMAGE_NAME
196+
197+
- name: Define SERVER_ENDPOINT variable if needed
198+
if: matrix.backend-version == '24.1' || matrix.backend-version == '24.2' || matrix.backend-version == '25.1'
199+
run: |
200+
$env:SERVER_ENDPOINT = "-e [email protected]"
201+
echo "SERVER_ENDPOINT variable set to: $env:SERVER_ENDPOINT"
202+
echo "SERVER_ENDPOINT=$env:SERVER_ENDPOINT" | Out-File -FilePath $env:GITHUB_ENV -Append
203+
204+
- name: Start Geometry service and verify start
205+
env:
206+
FULL_IMAGE_NAME: "${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.image-tag }}"
207+
PORT_MAPPING: "${{ env.ANSRV_GEO_PORT }}:50051"
208+
TRANSPORT_MODE_SELECTION: ${{ secrets.TRANSPORT_MODE_SELECTION }}
209+
run: |
210+
.\.venv\Scripts\Activate.ps1
211+
# Write command to file launch.txt for sanitizing purposes
212+
echo "docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER $env:SERVER_ENDPOINT -p $env:PORT_MAPPING $env:FULL_IMAGE_NAME $env:TRANSPORT_MODE_SELECTION" | Out-File -FilePath launch.txt
213+
# Read the file and execute the command
214+
$command = Get-Content -Path launch.txt | Select-String -Pattern "docker run"
215+
Invoke-Expression $command.Line
216+
Start-Sleep -Seconds 10
217+
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
218+
219+
- name: Testing
220+
timeout-minutes: 20 # Sometimes hangs...
221+
env:
222+
BACKEND_VERSION: ${{ matrix.backend-version }}
223+
run: |
224+
.\.venv\Scripts\Activate.ps1
225+
pytest -v --backwards-compatibility=yes --backend-version=$env:BACKEND_VERSION -rf
226+
227+
- name: Upload coverage to Codecov
228+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
229+
env:
230+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
231+
with:
232+
files: .cov/xml
233+
234+
- name: Stop the Geometry service
235+
if: always()
236+
run: |
237+
docker stop $env:GEO_CONT_NAME
238+
docker logs $env:GEO_CONT_NAME
239+
docker rm $env:GEO_CONT_NAME

0 commit comments

Comments
 (0)