Test Run Dev Version Nightly #317
This file contains 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: Test Run Dev Version Nightly | |
on: | |
schedule: # UTC at 0300 | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
PYFLUENT_TIMEOUT_FORCE_EXIT: 30 | |
PYFLUENT_LAUNCH_CONTAINER: 1 | |
PYFLUENT_LOGGING: 'DEBUG' | |
PYFLUENT_WATCHDOG_DEBUG: 'OFF' | |
PYFLUENT_HIDE_LOG_SECRETS: 1 | |
MAIN_PYTHON_VERSION: '3.10' | |
FLUENT_IMAGE_TAG: v25.2.0 | |
FLUENT_VERSION: 252 | |
jobs: | |
test: | |
name: Unit Testing | |
runs-on: [self-hosted, pyfluent] | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: Python-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
Python-${{ runner.os }}-${{ matrix.python-version }} | |
- 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@v3 | |
with: | |
registry: ghcr.io | |
username: ansys-bot | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Fluent docker image | |
run: make docker-pull | |
env: | |
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} | |
- name: Run API codegen | |
run: make api-codegen | |
env: | |
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} | |
- name: Print Fluent version info | |
run: | | |
cat src/ansys/fluent/core/generated/fluent_version_${{ env.FLUENT_VERSION }}.py | |
python -c "from ansys.fluent.core.generated.solver.settings_${{ env.FLUENT_VERSION }} 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-${{ env.FLUENT_VERSION }} | |
env: | |
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} | |
- name: Cleanup previous docker containers | |
if: always() | |
run: make cleanup-previous-docker-containers | |
- name: Update Fluent image | |
env: | |
GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }} | |
if: github.ref == 'refs/heads/main' | |
run: | | |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/ansys/pyfluent:${{ env.FLUENT_IMAGE_TAG }} | sed 's/.*@//') | |
gh variable set FLUENT_STABLE_IMAGE_DEV --body $DIGEST | |
clean-up: | |
name: Remove docker image | |
runs-on: [self-hosted, pyfluent] | |
if: ${{ always() }} | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Delete 25.1 Fluent docker image | |
run: docker rmi -f ghcr.io/ansys/pyfluent:${{ env.FLUENT_IMAGE_TAG }} |