Skip to content
Merged
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
31 changes: 31 additions & 0 deletions .ci/compare_flobject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import platform
import subprocess
import uuid


def compare_flobject():
image_name = f"ghcr.io/pyansys/pyfluent:v23.1.0"
container_name = uuid.uuid4().hex
is_linux = platform.system() == "Linux"
subprocess.run(
f"docker container create --name {container_name} {image_name}",
shell=is_linux,
)
xml_source = f"/ansys_inc/v231/fluent/fluent23.1.0/cortex/pylib/flapi/flobject.py"
subprocess.run(
f"docker cp {container_name}:{xml_source} fluent_flobject.py", shell=is_linux
)
subprocess.run(f"docker container rm {container_name}", shell=is_linux)
p = subprocess.run(
f"diff -u fluent_flobject.py src/ansys/fluent/core/solver/flobject.py",
shell=is_linux,
capture_output=True,
text=True,
)
print(p.stdout)
if p.returncode != 0:
raise RuntimeError("flobject.py is different in Fluent and PyFLuent.")


if __name__ == "__main__":
compare_flobject()
33 changes: 33 additions & 0 deletions .github/workflows/compare-flobject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Compare flobject between Fluent and PyFluent

on:
schedule: # UTC at 0400
- cron: '0 4 * * *'
workflow_dispatch:

jobs:
compare_flobject:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.REPO_DOWNLOAD_PAT }}

- name: Pull Fluent docker image
run: make docker-pull
env:
FLUENT_IMAGE_TAG: v23.1.0

- name: Compare flobject
run: make compare-flobject
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ build-doc:
@xvfb-run make -C doc html
@touch doc/_build/html/.nojekyll
@echo "$(DOCS_CNAME)" >> doc/_build/html/CNAME

compare-flobject:
@python .ci/compare_flobject.py