build: Bump version 0.38.dev1 (#4701) #14371
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GitHub Actions | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - ".github/workflows/run-custom-tests.yml" | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "*" | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: read | |
| pull-requests: read | |
| issues: read | |
| env: | |
| API_CODE_CACHE: 7 | |
| DOCUMENTATION_CNAME: "fluent.docs.pyansys.com" | |
| PACKAGE_NAME: "ansys-fluent-core" | |
| PACKAGE_NAMESPACE: "ansys.fluent.core" | |
| ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
| MAIN_PYTHON_VERSION: "3.10" | |
| PYTHON_VERSION: "3.12" | |
| PYFLUENT_TIMEOUT_FORCE_EXIT: 30 | |
| PYTEST_XDIST_AUTO_NUM_WORKERS: 4 | |
| PYFLUENT_LAUNCH_CONTAINER: 1 | |
| PYFLUENT_LOGGING: "DEBUG" | |
| PYFLUENT_WATCHDOG_DEBUG: "OFF" | |
| PYFLUENT_HIDE_LOG_SECRETS: 1 | |
| PYFLUENT_LAUNCH_FLUENT_TIMEOUT: 180 | |
| jobs: | |
| add-license-headers: | |
| name: "Add license headers" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: "Install and run add-license-headers" | |
| shell: bash | |
| run: | | |
| python -m pip install -U pip | |
| pip install pre-commit | |
| pre-commit install | |
| pre-commit run add-license-headers --all-files --hook-stage manual | |
| update-changelog: | |
| name: "Update CHANGELOG (on release)" | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: ansys/actions/[email protected] | |
| with: | |
| bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
| bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| docs-style: | |
| name: Documentation Style Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Running Vale | |
| uses: ansys/actions/[email protected] | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| code-style: | |
| name: Code style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Run PyAnsys code style checks" | |
| uses: ansys/actions/[email protected] | |
| commit-style: | |
| name: "Run commit style checks" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/[email protected] | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| test-import: | |
| name: Build and Smoke tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| should-release: | |
| - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }} | |
| exclude: | |
| - should-release: false | |
| os: macos-latest | |
| steps: | |
| - name: Build wheelhouse and perform smoke test | |
| uses: ansys/actions/[email protected] | |
| with: | |
| library-name: ${{ env.PACKAGE_NAME }} | |
| operating-system: ${{ matrix.os }} | |
| python-version: ${{ matrix.python-version }} | |
| check-vulnerabilities: | |
| name: "Check library vulnerabilities" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/check-vulnerabilities@main | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
| python-package-name: ${{ env.PACKAGE_NAME }} | |
| dev-mode: ${{ github.ref != 'refs/heads/main' }} | |
| upload-reports: True | |
| hide-log: false | |
| bandit-configfile: "pyproject.toml" | |
| actions-security: | |
| name: "Actions Security" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4 | |
| with: | |
| generate-summary: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| auditing-level: "high" | |
| docs_build: | |
| name: Build Documentation | |
| needs: [docs-style] | |
| runs-on: [self-hosted, pyfluent] | |
| env: | |
| DOC_DEPLOYMENT_IMAGE_TAG: v25.2.3 | |
| PYFLUENT_CONTAINER_MOUNT_SOURCE: "/home/ansys/Downloads/ansys_fluent_core_examples" | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install OS packages | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install pandoc libegl1 make xvfb libfontconfig1 libxrender1 libxkbcommon-x11-0 -y | |
| - name: Cache pip | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/pip | |
| key: Python-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| Python-${{ runner.os }}-${{ env.PYTHON_VERSION }} | |
| lookup-only: false # zizmor: ignore[cache-poisoning] | |
| - name: Install Quarto | |
| uses: quarto-dev/quarto-actions/setup@9e48da27e184aa238fcb49f5db75469626d43adb # v2.1.9 | |
| - name: Check Quarto Version | |
| shell: bash | |
| run: | | |
| quarto --version | |
| - name: Verify tinytex is installed | |
| run: | | |
| quarto install tinytex --no-prompt --update-path | |
| - name: "Install Poppler for PDF to PNG conversion" | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y poppler-utils | |
| - name: Install pyfluent | |
| run: make install | |
| - name: Retrieve PyFluent version | |
| run: | | |
| echo "PYFLUENT_VERSION=$(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" >> $GITHUB_OUTPUT | |
| echo "PYFLUENT version is: $(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" | |
| id: version | |
| - name: Cache API Code | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| id: cache-api-code | |
| with: | |
| path: | | |
| src/ansys/fluent/core/generated | |
| key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} | |
| lookup-only: false # zizmor: ignore[cache-poisoning] | |
| - name: Login to GitHub Container Registry | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ansys-bot | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} | |
| - name: Run API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} | |
| - name: Install again after codegen | |
| run: | | |
| rm -rf dist | |
| make install > /dev/null | |
| - name: Build Source Documentation | |
| run: | | |
| pip install -r requirements/requirements_build.txt | |
| pip install ansys-fluent-core[docs,reader,tests] | |
| make build-doc-source | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} | |
| - name: Zip HTML Documentation before upload | |
| env: | |
| DOC_DEPLOYMENT_IMG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} | |
| run: | | |
| sudo apt install zip -y | |
| pushd doc/_build/html | |
| zip -r ../../../HTML-Documentation-tag-${DOC_DEPLOYMENT_IMG}.zip . | |
| popd | |
| - name: Upload HTML Documentation | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }} | |
| path: HTML-Documentation-tag-${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}.zip | |
| retention-days: 7 | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| build: | |
| name: Build | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| runs-on: [self-hosted, pyfluent] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: Cache pip | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/pip | |
| key: Python-${{ runner.os }}-${{ env.MAIN_PYTHON_VERSION }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| Python-${{ runner.os }}-${{ env.MAIN_PYTHON_VERSION }} | |
| lookup-only: false # zizmor: ignore[cache-poisoning] | |
| - name: Add version information | |
| run: make version-info | |
| - name: Install pyfluent | |
| run: make install | |
| - name: Retrieve PyFluent version | |
| run: | | |
| echo "PYFLUENT_VERSION=$(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" >> $GITHUB_OUTPUT | |
| echo "PYFLUENT version is: $(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" | |
| id: version | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ansys-bot | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache API Code | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| id: cache-api-code | |
| with: | |
| path: src/ansys/fluent/core/generated | |
| # Combined cache key for all versions: | |
| # API-Code-<Cache version>-<PyFluent version>-<First Fluent release version>-<Last Fluent release version>-<Fluent dev version>-<Hash of codegen files> | |
| key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v23.1.0-v25.2.3-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} | |
| lookup-only: false # zizmor: ignore[cache-poisoning] | |
| - name: Pull 23.1 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v23.1.0 | |
| - name: Run 23.1 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v23.1.0 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 23.1 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_231.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_231 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 23.2 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v23.2.0 | |
| - name: Run 23.2 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v23.2.0 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 23.2 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_232.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_232 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 24.1 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v24.1.0 | |
| - name: Run 24.1 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v24.1.0 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 24.1 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_241.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_241 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 24.2 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v24.2.5 | |
| - name: Run 24.2 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v24.2.5 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 24.2 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_242.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_242 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 25.1 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v25.1.4 | |
| - name: Run 25.1 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v25.1.4 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 25.1 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_251.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 25.2 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: v25.2.3 | |
| - name: Run 25.2 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: v25.2.3 | |
| PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 | |
| - name: Print 25.2 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_252.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_252 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| - name: Pull 26.1 Fluent docker image | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} | |
| - name: Run 26.1 API codegen | |
| if: steps.cache-api-code.outputs.cache-hit != 'true' | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} | |
| - name: Print 26.1 Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_261.py | |
| python -c "from src.ansys.fluent.core.generated.solver.settings_261 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Install again after codegen | |
| run: | | |
| rm -rf dist | |
| make install > /dev/null | |
| - name: Check package | |
| run: | | |
| pip install twine | |
| twine check dist/* | |
| - name: Upload package | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: PyFluent-packages | |
| path: | | |
| dist/*.whl | |
| dist/*.tar.gz | |
| retention-days: 7 | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| test: | |
| name: Unit Testing | |
| if: ${{ always() }} | |
| needs: build | |
| runs-on: [public-ubuntu-latest-8-cores] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image-tag: v23.1.0 | |
| version: 231 | |
| - image-tag: v23.2.0 | |
| version: 232 | |
| - image-tag: v24.1.0 | |
| version: 241 | |
| - image-tag: v24.2.5 | |
| version: 242 | |
| - image-tag: v25.1.4 | |
| version: 251 | |
| - image-tag: v25.2.3 | |
| version: 252 | |
| - image-tag: v26.1.latest | |
| version: 261 | |
| timeout-minutes: 60 | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ matrix.version == 261 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Python | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: Download package | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: PyFluent-packages | |
| path: dist | |
| - name: Install pyfluent | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| run: pip install -q --force-reinstall dist/*.whl > /dev/null | |
| - name: Retrieve PyFluent version | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| run: | | |
| echo "PYFLUENT_VERSION=$(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" >> $GITHUB_OUTPUT | |
| echo "PYFLUENT version is: $(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" | |
| id: version | |
| - name: Login to GitHub Container Registry | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ansys-bot | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull Fluent docker image | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| run: make docker-pull | |
| - name: Unit Testing | |
| if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} | |
| env: | |
| MATRIX_VERSION: ${{ matrix.version }} | |
| run: | | |
| make install-test | |
| make unittest-dev-${MATRIX_VERSION} | |
| - name: Cleanup previous docker containers | |
| if: always() | |
| run: make cleanup-previous-docker-containers | |
| - name: Upload 25.2 Coverage Artifacts | |
| if: matrix.image-tag == 'v25.2.3' | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: coverage_report | |
| path: ./htmlcov | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| nightly-dev-test: | |
| name: Release Testing | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'dev') | |
| runs-on: [self-hosted, pyfluent] | |
| env: | |
| PYTEST_XDIST_AUTO_NUM_WORKERS: 1 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: Cache pip | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/pip | |
| key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| Python-${{ runner.os }}-${{ matrix.python-version }} | |
| lookup-only: false # zizmor: ignore[cache-poisoning] | |
| - name: Add version information | |
| run: make version-info | |
| - name: Install pyfluent | |
| run: make install | |
| - name: Retrieve PyFluent version | |
| run: | | |
| echo "PYFLUENT_VERSION=$(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" >> $GITHUB_OUTPUT | |
| echo "PYFLUENT version is: $(python -c "from ansys.fluent.core import __version__; print(); print(__version__)" | tail -1)" | |
| id: version | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ansys-bot | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull Fluent docker image | |
| run: make docker-pull | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} | |
| - name: Run API codegen | |
| run: make api-codegen | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} | |
| - name: Print Fluent version info | |
| run: | | |
| cat src/ansys/fluent/core/generated/fluent_version_261.py | |
| python -c "from ansys.fluent.core.generated.solver.settings_261 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" | |
| - name: Install again after codegen | |
| run: | | |
| rm -rf dist | |
| make install > /dev/null | |
| - name: Unit Testing | |
| run: | | |
| make install-test | |
| make unittest-all-261 | |
| env: | |
| FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} | |
| - name: Cleanup previous docker containers | |
| if: always() | |
| run: make cleanup-previous-docker-containers | |
| - name: Remove all docker images | |
| if: always() | |
| run: make docker-clean-images | |
| release: | |
| name: Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| needs: [test, update-changelog] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # required for trusted publishing | |
| contents: write # required for GitHub release upload | |
| steps: | |
| - name: Set up Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
| - name: "Download the library artifacts from build-library step" | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: PyFluent-packages | |
| path: PyFluent-packages | |
| - name: Display package file list | |
| run: ls -R | |
| - name: Upload to Private PyPi | |
| run: | | |
| pip install 'twine<6.2.0' | |
| python -m twine upload --skip-existing ./**/*.whl | |
| python -m twine upload --skip-existing ./**/*.tar.gz | |
| env: | |
| TWINE_USERNAME: PAT | |
| TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | |
| TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload | |
| - name: "Upload artifacts to PyPI using trusted publisher" | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| with: | |
| repository-url: "https://upload.pypi.org/legacy/" | |
| print-hash: true | |
| packages-dir: PyFluent-packages | |
| skip-existing: false | |
| - name: Release | |
| uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1 | |
| with: | |
| files: | | |
| ./**/*.whl | |
| ./**/*.tar.gz | |
| ./**/*-wheelhouse-*.zip |