Execute Examples Weekly #113
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: Execute Examples Weekly | |
| on: | |
| schedule: # UTC at 0400 on Saturday | |
| - cron: "0 4 * * SAT" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: read | |
| pull-requests: read | |
| issues: read | |
| env: | |
| ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
| PYFLUENT_TIMEOUT_FORCE_EXIT: 30 | |
| PYFLUENT_LAUNCH_CONTAINER: 1 | |
| PYFLUENT_VIZ_BLOCKING: 1 | |
| PYFLUENT_LOGGING: "DEBUG" | |
| PYFLUENT_WATCHDOG_DEBUG: "OFF" | |
| PYFLUENT_HIDE_LOG_SECRETS: 1 | |
| PYTHON_VERSION: "3.12" | |
| PYFLUENT_SKIP_API_UPGRADE_ADVICE: 1 | |
| jobs: | |
| execute_examples: | |
| name: Build | |
| runs-on: [public-ubuntu-latest-8-cores] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image-tag: v25.2.0 | |
| version: 252 | |
| - image-tag: v26.1.0 | |
| version: 261 | |
| 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 | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - 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 }} | |
| - 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: Install pyfluent | |
| run: | | |
| make install | |
| make install-test | |
| - name: Pull Fluent docker image if not present | |
| env: | |
| IMAGE_TAG: ${{ matrix.image-tag }} | |
| run: | | |
| if ! docker image inspect fluent:${IMAGE_TAG} > /dev/null 2>&1; then | |
| echo "Image not found locally, pulling..." | |
| make docker-pull | |
| else | |
| echo "Image already exists locally, skipping pull." | |
| fi | |
| - name: Install Dependencies | |
| run: | | |
| sudo mkdir -p /home/ansys/Downloads/ansys_fluent_core_examples | |
| sudo chmod a+rwx /home/ansys/Downloads/ansys_fluent_core_examples | |
| sudo apt update | |
| sudo apt install libegl1 | |
| pip install ansys-fluent-visualization | |
| pip install xgboost scikit-learn tensorflow seaborn plotly numpy pandas | |
| - name: Execute Examples | |
| run: | | |
| echo "Executing examples" | |
| sudo rm -rf /home/ansys/Downloads/ansys_fluent_core_examples/* | |
| # ~1 minute | |
| - name: Execute mixing_elbow_settings_api.py | |
| run: | | |
| python examples/00-fluent/mixing_elbow_settings_api.py | |
| # ~1 minute | |
| - name: Execute species_transport.py | |
| run: | | |
| python examples/00-fluent/species_transport.py | |
| # ~1 minute | |
| - name: Execute modeling_cavitation.py | |
| run: | | |
| python examples/00-fluent/modeling_cavitation.py | |
| # ~3 minutes | |
| - name: Execute ahmed_body_workflow.py | |
| run: | | |
| python examples/00-fluent/ahmed_body_workflow.py | |
| # ~4 minutes | |
| - name: Execute exhaust_system_settings_api.py | |
| run: | | |
| python examples/00-fluent/exhaust_system_settings_api.py | |
| # ~4 minutes | |
| - name: Execute parametric_static_mixer_1.py | |
| run: | | |
| python examples/00-fluent/parametric_static_mixer_1.py | |
| # ~5 minutes | |
| - name: Execute brake.py | |
| run: | | |
| python examples/00-fluent/brake.py | |
| # ~5 minutes | |
| - name: Execute external_compressible_flow.py | |
| run: | | |
| python examples/00-fluent/external_compressible_flow.py | |
| # ~15 minutes | |
| - name: Execute radiation_headlamp.py | |
| run: | | |
| python examples/00-fluent/radiation_headlamp.py | |
| # ~17 minutes | |
| - name: Execute DOE_ML.py | |
| run: | | |
| python examples/00-fluent/DOE_ML.py | |
| # ~17 minutes | |
| - name: Execute frozen_rotor_workflow.py | |
| run: | | |
| python examples/00-fluent/frozen_rotor_workflow.py | |
| # ~26 minutes, hangs for v26.1.0 | |
| - name: Execute lunar_lander_thermal.py | |
| run: | | |
| python examples/00-fluent/lunar_lander_thermal.py | |
| # ~40 minutes | |
| - name: Execute tyler_sofrin_modes.py | |
| run: | | |
| python examples/00-fluent/tyler_sofrin_modes.py | |
| - name: Execute single_battery_cell_workflow.py | |
| run: | | |
| python examples/00-fluent/single_battery_cell_workflow.py | |
| - name: Execute steady_vortex.py | |
| run: | | |
| python examples/00-fluent/steady_vortex.py | |
| - name: Execute Modeling_solidification_workflow.py | |
| run: | | |
| python examples/00-fluent/Modeling_solidification_workflow.py | |
| - name: Execute catalytic_converter_workflow.py | |
| run: | | |
| python examples/00-fluent/catalytic_converter_workflow.py | |
| - name: Execute fsi_1way_workflow.py | |
| run: | | |
| python examples/00-fluent/fsi_1way_workflow.py | |
| - name: Execute transient_compressible_nozzle_workflow.py | |
| run: | | |
| python examples/00-fluent/transient_compressible_nozzle_workflow.py | |
| - name: Execute Electrolysis_Modeling_workflow.py | |
| run: | | |
| python examples/00-fluent/Electrolysis_Modeling_workflow.py | |
| - name: Execute battery_pack.py | |
| run: | | |
| python examples/00-fluent/battery_pack.py | |
| # https://github.com/ansys/pyfluent/issues/4157 | |
| # - name: Execute conjugate_heat_transfer.py | |
| # run: | | |
| # python examples/00-fluent/conjugate_heat_transfer.py | |
| # env: | |
| # FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} | |
| # RuntimeError: Unable to load hsf library and requires separate license. | |
| # - name: Execute modeling_ablation.py | |
| # run: | | |
| # python examples/00-fluent/modeling_ablation.py | |
| # env: | |
| # FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} | |
| - 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 |