Skip to content

Commit a77a048

Browse files
authored
Merge branch 'main' into maint/update-contributors-file
2 parents f582d48 + 1b3f923 commit a77a048

File tree

194 files changed

+11602
-1149
lines changed

Some content is hidden

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

194 files changed

+11602
-1149
lines changed

.github/codeql-config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
paths:
33
- src
44
- tests
5-
paths-ignore:
6-
- '**/failing_script.py'
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Backwards compatibility tests
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "*"
8+
branches:
9+
- main
10+
11+
env:
12+
MAIN_PYTHON_VERSION: '3.13'
13+
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
14+
ANSRV_GEO_PORT: 700
15+
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
16+
GEO_CONT_NAME: ans_geo
17+
IS_WORKFLOW_RUNNING: True
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
packages: read
26+
id-token: write
27+
28+
jobs:
29+
30+
# =================================================================================================
31+
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
32+
# =================================================================================================
33+
34+
testing-backwards-compatibility-windows:
35+
name: Windows ${{ matrix.backend-version }}
36+
runs-on: [self-hosted, Windows, pygeometry]
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include:
41+
- image-tag: "windows-24.1"
42+
backend-version: "24.1"
43+
- image-tag: "windows-24.2"
44+
backend-version: "24.2"
45+
- image-tag: "windows-25.1"
46+
backend-version: "25.1"
47+
- image-tag: "core-windows-25.2"
48+
backend-version: "25.2"
49+
steps:
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
54+
with:
55+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
56+
57+
- name: Set up headless display
58+
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2
59+
60+
- name: Create Python venv
61+
run: |
62+
python -m venv .venv
63+
.\.venv\Scripts\Activate.ps1
64+
65+
- name: Install packages for testing
66+
run: |
67+
.\.venv\Scripts\Activate.ps1
68+
python -m pip install --upgrade pip
69+
pip install --upgrade build wheel
70+
pip install .[tests]
71+
72+
- name: Login to GitHub Container Registry
73+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: Download Geometry service container (if needed)
80+
run: docker pull ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.image-tag }}
81+
82+
- name: Check location of self-hosted runner and define license server accordingly
83+
if: runner.name == 'pygeometry-ci-2'
84+
run:
85+
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append
86+
87+
- name: Stop any running containers
88+
run: |
89+
$dockerContainers = docker ps -a -q
90+
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
91+
docker stop $dockerContainers
92+
docker rm $dockerContainers
93+
}
94+
95+
- name: Start Geometry service and verify start
96+
run: |
97+
.\.venv\Scripts\Activate.ps1
98+
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.image-tag }}
99+
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
100+
101+
- name: Testing
102+
run: |
103+
.\.venv\Scripts\Activate.ps1
104+
pytest -v --backwards-compatibility=yes --backend-version=${{ matrix.backend-version }} -rf
105+
106+
- name: Upload coverage to Codecov
107+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
108+
env:
109+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
110+
with:
111+
files: .cov/xml
112+
113+
- name: Stop the Geometry service
114+
if: always()
115+
run: |
116+
docker stop ${{ env.GEO_CONT_NAME }}
117+
docker logs ${{ env.GEO_CONT_NAME }}
118+
docker rm ${{ env.GEO_CONT_NAME }}
119+
120+
- name: Stop any remaining containers
121+
if: always()
122+
run: |
123+
$dockerContainers = docker ps -a -q
124+
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
125+
docker stop $dockerContainers
126+
docker rm $dockerContainers
127+
}
128+
129+
# =================================================================================================
130+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131+
# =================================================================================================

0 commit comments

Comments
 (0)