Skip to content

Commit

Permalink
ci: Run unittests with 25.2 Fluent image in CIs (#3485)
Browse files Browse the repository at this point in the history
* ci: Run unittests with 25.2 Fluent image in CIs

* ci: Add missing step

* ci: PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS

* ci: fix

* ci: merge 25.2 testrun

* ci: minor
  • Loading branch information
mkundu1 authored Nov 15, 2024
1 parent 6597d4f commit 1b73626
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 48 deletions.
76 changes: 40 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,55 +418,57 @@ jobs:
doc/source/api/core/meshing/datamodel
doc/source/api/core/solver/tui
doc/source/api/core/solver/datamodel
key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }}
restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }}
key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.1.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }}
restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.1.0

- name: Pull 25.1 Fluent docker image
if: steps.cache-251-api-code.outputs.cache-hit != 'true'
run: make docker-pull
env:
FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }}
FLUENT_IMAGE_TAG: v25.1.0

- name: Run 25.1 API codegen
if: steps.cache-251-api-code.outputs.cache-hit != 'true'
run: make api-codegen
env:
FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }}
FLUENT_IMAGE_TAG: v25.1.0
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 ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')"
# - name: Cache 25.2 API Code
# uses: actions/cache@v4
# id: cache-252-api-code
# with:
# path:
# src/ansys/fluent/core/generated
# doc/source/api/core/meshing/tui
# doc/source/api/core/meshing/datamodel
# doc/source/api/core/solver/tui
# doc/source/api/core/solver/datamodel
# key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }}
# restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0

# - name: Pull 25.2 Fluent docker image
# if: steps.cache-252-api-code.outputs.cache-hit != 'true'
# run: make docker-pull
# env:
# FLUENT_IMAGE_TAG: v25.2.0

# - name: Run 25.2 API codegen
# if: steps.cache-252-api-code.outputs.cache-hit != 'true'
# run: make api-codegen
# env:
# FLUENT_IMAGE_TAG: v25.2.0

# - name: Print 25.2 Fluent version info
# run: |
# cat src/ansys/fluent/core/generated/fluent_version_252.py
# python -c "from ansys.fluent.core.generated.solver.settings_252 import SHASH; print(f'SETTINGS_HASH = {SHASH}')"
# Replace v25.2.0 with ${{ vars.FLUENT_STABLE_IMAGE_DEV }} after the first successful nightly test run
- name: Cache 25.2 API Code
uses: actions/cache@v4
id: cache-252-api-code
with:
path:
src/ansys/fluent/core/generated
doc/source/api/core/meshing/tui
doc/source/api/core/meshing/datamodel
doc/source/api/core/solver/tui
doc/source/api/core/solver/datamodel
key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }}
restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0

- name: Pull 25.2 Fluent docker image
if: steps.cache-251-api-code.outputs.cache-hit != 'true'
run: make docker-pull
env:
FLUENT_IMAGE_TAG: v25.2.0

- name: Run 25.2 API codegen
if: steps.cache-252-api-code.outputs.cache-hit != 'true'
run: make api-codegen
env:
FLUENT_IMAGE_TAG: v25.2.0

- name: Print 25.2 Fluent version info
run: |
cat src/ansys/fluent/core/generated/fluent_version_252.py
python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')"
- name: Install again after codegen
run: |
Expand Down Expand Up @@ -508,11 +510,13 @@ jobs:
version: 242
- image-tag: v25.1.0
version: 251
# - image-tag: v25.2.0
# version: 252
- image-tag: v25.2.0
version: 252
timeout-minutes: 120
env:
FLUENT_IMAGE_TAG: ${{ matrix.version == 251 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }}
# Enable this after the first successful nightly test run
# FLUENT_IMAGE_TAG: ${{ matrix.version == 252 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }}
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

steps:

Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/test-run-dev-version-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
name: Unit Testing
runs-on: [self-hosted, pyfluent]
timeout-minutes: 120
env:
FLUENT_IMAGE_TAG: v25.2.0
FLUENT_VERSION: 252

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -55,32 +58,32 @@ jobs:
username: ansys-bot
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull 25.1 Fluent docker image
- name: Pull Fluent docker image
run: make docker-pull
env:
FLUENT_IMAGE_TAG: v25.1.0
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }}

- name: Run 25.1 API codegen
- name: Run API codegen
run: make api-codegen
env:
FLUENT_IMAGE_TAG: v25.1.0
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }}

- name: Print 25.1 Fluent version info
- name: Print Fluent version info
run: |
cat src/ansys/fluent/core/generated/fluent_version_251.py
python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')"
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: 25.1 Unit Testing
- name: Unit Testing
run: |
make install-test
make unittest-all-251
make unittest-all-{{ env.FLUENT_VERSION }}
env:
FLUENT_IMAGE_TAG: v25.1.0
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }}

- name: Cleanup previous docker containers
if: always()
Expand All @@ -91,7 +94,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }}
if: github.ref == 'refs/heads/main'
run: |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/ansys/pyfluent:v25.1.0 | sed 's/.*@//')
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:
Expand All @@ -104,4 +107,4 @@ jobs:
- uses: actions/checkout@v4

- name: Delete 25.1 Fluent docker image
run: docker rmi -f ghcr.io/ansys/pyfluent:v25.1.0
run: docker rmi -f ghcr.io/ansys/pyfluent:{{ env.FLUENT_IMAGE_TAG }}

0 comments on commit 1b73626

Please sign in to comment.