Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 118 additions & 101 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,74 +77,74 @@ jobs:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
dev-mode: true

tests:
name: tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: ["windows-latest", "ubuntu-22.04"]

steps:
- uses: actions/checkout@v5

- name: "Set licensing if necessary"
if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT) > '231' }}
shell: bash
run: |
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV

- name: "Build Package"
uses: ansys/pydpf-actions/build_package@v2.3
with:
python-version: ${{ matrix.python-version }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
MODULE: ${{env.MODULE}}
dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
install_extras: graphics
# Upload the wheel artifact for only one of the OS as it is OS-agnostic
wheel: ${{ (matrix.python-version == env.MAIN_PYTHON_VERSION) && (matrix.os == 'windows-latest') }}
wheelhouse: true
standalone_suffix: ${{ inputs.standalone_suffix || ''}}

- name: "Prepare Testing Environment"
uses: ansys/pydpf-actions/prepare_tests@v2.3
with:
DEBUG: true

- name: "List installed packages"
shell: bash
run: pip list

- name: "Test Docstrings"
uses: ansys/pydpf-actions/test_docstrings@v2.3
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
with:
MODULE: ${{env.MODULE}}
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
working-directory: src

- name: "Test API"
shell: bash
working-directory: tests
run: |
pytest $DEBUG --cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=junit/test-results.xml --reruns 2 .

- name: "Kill all servers"
uses: ansys/pydpf-actions/kill-dpf-servers@v2.3
if: always()

- name: "Upload Test Results"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ env.ANSYS_VERSION }}
path: tests/junit/test-results.xml

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5
# tests:
# name: tests
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.9", "3.10", "3.11"]
# os: ["windows-latest", "ubuntu-22.04"]
#
# steps:
# - uses: actions/checkout@v5
#
# - name: "Set licensing if necessary"
# if: ${{ (github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT) > '231' }}
# shell: bash
# run: |
# echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
# echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
#
# - name: "Build Package"
# uses: ansys/pydpf-actions/build_package@v2.3
# with:
# python-version: ${{ matrix.python-version }}
# ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
# PACKAGE_NAME: ${{env.PACKAGE_NAME}}
# MODULE: ${{env.MODULE}}
# dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}}
# install_extras: graphics
# # Upload the wheel artifact for only one of the OS as it is OS-agnostic
# wheel: ${{ (matrix.python-version == env.MAIN_PYTHON_VERSION) && (matrix.os == 'windows-latest') }}
# wheelhouse: true
# standalone_suffix: ${{ inputs.standalone_suffix || ''}}
#
# - name: "Prepare Testing Environment"
# uses: ansys/pydpf-actions/prepare_tests@v2.3
# with:
# DEBUG: true
#
# - name: "List installed packages"
# shell: bash
# run: pip list
#
# - name: "Test Docstrings"
# uses: ansys/pydpf-actions/test_docstrings@v2.3
# if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
# with:
# MODULE: ${{env.MODULE}}
# PACKAGE_NAME: ${{env.PACKAGE_NAME}}
# working-directory: src
#
# - name: "Test API"
# shell: bash
# working-directory: tests
# run: |
# pytest $DEBUG --cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=junit/test-results.xml --reruns 2 .
#
# - name: "Kill all servers"
# uses: ansys/pydpf-actions/kill-dpf-servers@v2.3
# if: always()
#
# - name: "Upload Test Results"
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ env.ANSYS_VERSION }}
# path: tests/junit/test-results.xml
#
# - name: "Upload coverage to Codecov"
# uses: codecov/codecov-action@v5

retro:
name: "Test DPF ${{ matrix.ANSYS_VERSION.version }}${{ matrix.ANSYS_VERSION.patch }} compatibility"
Expand Down Expand Up @@ -190,6 +190,23 @@ jobs:
shell: bash
run: pip list

- name: "Test: Remove gatebin"
shell: bash
run: |
DPF_PATH=`python -c "from ansys.dpf import core as dpf; import os; my_path = os.path.abspath(dpf.__file__); aux = my_path.split(os.sep); aux2 = aux[:-2]; print(''.join([a + os.sep for a in aux2]))"`

echo DPF_PATH
echo ${DPF_PATH}

echo Before removing gatebin
ls -al ${DPF_PATH}

echo Removing gatebin
rm -r ${DPF_PATH}gatebin

echo After removing gatebin
ls -al ${DPF_PATH}

- name: "Test API"
shell: bash
working-directory: tests
Expand All @@ -210,36 +227,36 @@ jobs:
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5

examples:
if: startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/examples.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
python_versions: '["3.10"]'
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
secrets: inherit

docs:
if: startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/docs.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
python_version: "3.10"
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
event_name: ${{ github.event_name }}
secrets: inherit

upload-development-docs:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [docs]
steps:
- name: "Upload development documentation"
uses: ansys/actions/doc-deploy-dev@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
doc-artifact-name: HTML-doc-ansys-dpf-post.zip
decompress-artifact: true
# examples:
# if: startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
# uses: ./.github/workflows/examples.yml
# with:
# ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
# python_versions: '["3.10"]'
# standalone_suffix: ${{ inputs.standalone_suffix || ''}}
# secrets: inherit#

# docs:
# if: startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
# uses: ./.github/workflows/docs.yml
# with:
# ANSYS_VERSION: ${{ github.event.inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
# python_version: "3.10"
# standalone_suffix: ${{ inputs.standalone_suffix || ''}}
# event_name: ${{ github.event_name }}
# secrets: inherit
#
# upload-development-docs:
# runs-on: ubuntu-latest
# if: ${{ github.ref == 'refs/heads/main' }}
# needs: [docs]
# steps:
# - name: "Upload development documentation"
# uses: ansys/actions/doc-deploy-dev@v10
# with:
# cname: ${{ env.DOCUMENTATION_CNAME }}
# token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
# bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
# bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
# doc-artifact-name: HTML-doc-ansys-dpf-post.zip
# decompress-artifact: true
7 changes: 0 additions & 7 deletions tests/test_fluid_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os

from ansys.dpf.core import examples
import pytest
from pytest import fixture
Expand All @@ -31,7 +29,6 @@
from conftest import (
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0,
)


Expand Down Expand Up @@ -72,10 +69,6 @@ def test_simulation_str(self, fluent_simulation):
assert fluent_simulation is not None
assert str(fluent_simulation)

@pytest.mark.skipif(
(not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_10_0) and (os.name == "posix"),
reason="Failing for DPF < 2025 R2 on Linux",
)
def test_simulation_flprj(self):
simulation = post.FluidSimulation(
flprj=examples.download_fluent_axial_comp()["flprj"]
Expand Down