Skip to content

Commit 72f928f

Browse files
committed
Merge branch 'main' into feat/main_commands
2 parents 8bb822c + a7d4359 commit 72f928f

File tree

404 files changed

+1997
-1168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404 files changed

+1997
-1168
lines changed

.ci/build_matrix.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ versions=(
99
# if added more "latest", change "$LATEST"
1010
'latest-ubuntu'
1111
'latest-ubuntu-student'
12+
'v25.2.0'
1213
'v25.1.0'
14+
'v25.1-ubuntu'
15+
'v25.1-ubuntu-student'
1316
'v24.2.0'
1417
'v24.2-ubuntu'
1518
'v24.2-ubuntu-student'
@@ -95,11 +98,11 @@ for version in "${versions[@]}"; do
9598
fi
9699

97100
# Skipping student versions on auth_user
98-
if [[ "$auth_user" == "true" && "$ON_STUDENT" == "true" ]]; then
99-
echo "Skipping student versions when user is authenticated"
100-
echo ""
101-
continue
102-
fi
101+
# if [[ "$auth_user" == "true" && "$ON_STUDENT" == "true" ]]; then
102+
# echo "Skipping student versions when user is authenticated"
103+
# echo ""
104+
# continue
105+
# fi
103106

104107
# main logic
105108
if [[ "$auth_user" == "true" ]]; then

.ci/collect_mapdl_logs_locals.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES"
3+
4+
cp *.log ./"$LOG_NAMES"/ || echo "No log files could be found"
5+
cp *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found"
6+
cp *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found"
7+
8+
9+
ls -la ./"$LOG_NAMES"
10+
11+
echo "Tar files..."
12+
tar cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress"

.ci/display_logs_locals.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
#####
3+
# Displaying files
4+
FILE_PAT=./"$LOG_NAMES"/pymapdl.log
5+
FILE_DESCRIPTION="PyMAPDL log"
6+
7+
if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"
8+
9+
#####
10+
FILE_PAT=./"$LOG_NAMES"/pymapdl.apdl
11+
FILE_DESCRIPTION="PyMAPDL APDL log"
12+
13+
if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"
14+
15+
#####
16+
FILE_PAT=./"$LOG_NAMES"/apdl.out
17+
FILE_DESCRIPTION="MAPDL Output"
18+
19+
if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"

.ci/requirements_minimal.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pyfakefs==5.7.2
2+
pytest-cov==6.0.0
3+
pytest-random-order==1.1.1
4+
pytest-rerunfailures==15.0
5+
pytest-timeout==2.3.1
6+
pytest==8.3.4

.github/workflows/ci.yml

Lines changed: 184 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ env:
2424
PACKAGE_NAME: 'ansys-mapdl-core'
2525
PACKAGE_NAMESPACE: 'ansys.mapdl.core'
2626
DOCUMENTATION_CNAME: 'mapdl.docs.pyansys.com'
27-
LATEST_VERSION: "242"
27+
LATEST_VERSION: "252"
2828
MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.2-ubuntu-student
2929
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
3030
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
@@ -33,9 +33,11 @@ env:
3333
DPF_PORT: 21004
3434
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
3535
ON_CI: True
36-
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html'
36+
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180'
37+
3738

3839
BUILD_CHEATSHEET: True
40+
PYMAPDL_DEBUG_TESTING: True
3941

4042
# Following env vars when changed will "reset" the mentioned cache,
4143
# by changing the cache file name. It is rendered as ...-v%RESET_XXX%-...
@@ -62,7 +64,6 @@ permissions:
6264

6365
jobs:
6466

65-
6667
update-changelog:
6768
name: "Update CHANGELOG (on release)"
6869
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
@@ -128,6 +129,7 @@ jobs:
128129
library-name: ${{ env.PACKAGE_NAME }}
129130
operating-system: ${{ matrix.os }}
130131
python-version: ${{ matrix.python-version }}
132+
whitelist-license-check: "attrs" # This has MIT license but fails the check
131133

132134
- name: "Importing library"
133135
run: |
@@ -149,6 +151,8 @@ jobs:
149151
python-package-name: ${{ env.PACKAGE_NAME }}
150152
dev-mode: ${{ github.ref != 'refs/heads/main' }}
151153
upload-reports: True
154+
hide-log: false
155+
152156

153157
docs-build:
154158
name: "Build documentation"
@@ -336,7 +340,7 @@ jobs:
336340
MAPDL_INSTANCE: MAPDL_0
337341
LOG_NAMES: logs-build-docs
338342
run: |
339-
.ci/collect_mapdl_logs.sh
343+
.ci/collect_mapdl_logs_remote.sh
340344
341345
- name: "Upload logs to GitHub"
342346
if: always()
@@ -351,7 +355,7 @@ jobs:
351355
MAPDL_INSTANCE: MAPDL_0
352356
LOG_NAMES: logs-build-docs
353357
run: |
354-
.ci/display_logs.sh
358+
.ci/display_logs_remote.sh
355359
356360
build-test-remote-matrix:
357361
name: "Build remote test matrix"
@@ -576,7 +580,7 @@ jobs:
576580
MAPDL_INSTANCE: MAPDL_0
577581
LOG_NAMES: logs-remote-${{ matrix.mapdl-version }}
578582
run: |
579-
.ci/collect_mapdl_logs.sh
583+
.ci/collect_mapdl_logs_remote.sh
580584
581585
- name: "Upload logs to GitHub"
582586
if: always()
@@ -591,7 +595,7 @@ jobs:
591595
MAPDL_INSTANCE: MAPDL_0
592596
LOG_NAMES: logs-remote-${{ matrix.mapdl-version }}
593597
run: |
594-
.ci/display_logs.sh
598+
.ci/display_logs_remote.sh
595599
596600
build-test-local-minimal-matrix:
597601
name: "Build test matrix for minimal and local"
@@ -615,7 +619,7 @@ jobs:
615619
- id: set-matrix
616620
env:
617621
ONLY_UBUNTU: true
618-
LIMIT_VERSIONS: 3
622+
LIMIT_VERSIONS: 2
619623
ON_SCHEDULE: ${{ github.event_name == 'schedule' }}
620624
ON_WORKFLOW_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }}
621625
RUN_ALL_TEST: ${{ inputs.run_all_tests }}
@@ -713,6 +717,27 @@ jobs:
713717
--reset_only_failed --add_missing_images \
714718
--cov-report=xml:${{ matrix.mapdl-version }}-local.xml
715719
720+
- name: "Collect logs on failure"
721+
if: always()
722+
env:
723+
LOG_NAMES: logs-local-${{ matrix.mapdl-version }}
724+
run: |
725+
.ci/collect_mapdl_logs_locals.sh
726+
727+
- name: "Upload logs to GitHub"
728+
if: always()
729+
uses: actions/upload-artifact@master
730+
with:
731+
name: logs-local-${{ matrix.mapdl-version }}.tgz
732+
path: ./logs-local-${{ matrix.mapdl-version }}.tgz
733+
734+
- name: "Display files structure"
735+
if: always()
736+
env:
737+
LOG_NAMES: logs-local-${{ matrix.mapdl-version }}
738+
run: |
739+
.ci/display_logs_locals.sh
740+
716741
- name: "Adding the directory as safe directory for later step"
717742
run: |
718743
git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -821,7 +846,7 @@ jobs:
821846
822847
- name: "Unit testing requirements installation"
823848
run: |
824-
python -m pip install pytest pytest-rerunfailures pytest-cov pytest-random-order
849+
python -m pip install -r .ci/requirements_minimal.txt
825850
826851
- name: "Unit testing"
827852
env:
@@ -850,6 +875,27 @@ jobs:
850875
${{ env.PYTEST_ARGUMENTS }} \
851876
--cov-report=xml:${{ matrix.mapdl-version }}-minimal.xml
852877
878+
- name: "Collect logs on failure"
879+
if: always()
880+
env:
881+
LOG_NAMES: logs-minimal-${{ matrix.mapdl-version }}
882+
run: |
883+
.ci/collect_mapdl_logs_locals.sh
884+
885+
- name: "Upload logs to GitHub"
886+
if: always()
887+
uses: actions/upload-artifact@master
888+
with:
889+
name: logs-minimal-${{ matrix.mapdl-version }}.tgz
890+
path: ./logs-minimal-${{ matrix.mapdl-version }}.tgz
891+
892+
- name: "Display files structure"
893+
if: always()
894+
env:
895+
LOG_NAMES: logs-minimal-${{ matrix.mapdl-version }}
896+
run: |
897+
.ci/display_logs_locals.sh
898+
853899
- uses: codecov/codecov-action@v5
854900
name: "Upload coverage to Codecov"
855901
with:
@@ -865,6 +911,135 @@ jobs:
865911
path: ./${{ matrix.mapdl-version }}-minimal.xml
866912

867913

914+
build-test-ubuntu-console:
915+
name: "Local-min-console: ${{ matrix.mapdl-version }}"
916+
runs-on: ubuntu-latest
917+
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
918+
needs: [smoke-tests, build-test-local-minimal-matrix]
919+
timeout-minutes: 75
920+
strategy:
921+
fail-fast: false
922+
matrix: ${{fromJson(needs.build-test-local-minimal-matrix.outputs.matrix)}}
923+
container:
924+
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-version }}
925+
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
926+
credentials:
927+
username: ${{ github.actor }}
928+
password: ${{ secrets.GITHUB_TOKEN }}
929+
env:
930+
ON_LOCAL: true
931+
ON_UBUNTU: true
932+
TESTING_MINIMAL: true
933+
ON_CONSOLE: true
934+
935+
steps:
936+
- name: "Install Git and checkout project"
937+
uses: actions/[email protected]
938+
with:
939+
repository: ${{ github.event.pull_request.head.repo.full_name }}
940+
ref: ${{ github.event.pull_request.head.ref }}
941+
942+
- name: "Get if running student version"
943+
id: student_check
944+
run: |
945+
if [[ "${{ matrix.mapdl-version }}" == *"student"* ]];
946+
then export ON_STUDENT=true; export TAG_STUDENT="student";
947+
else export ON_STUDENT=false; export TAG_STUDENT="non-student";
948+
fi
949+
950+
echo "ON_STUDENT: $ON_STUDENT"
951+
echo "TAG_STUDENT: $TAG_STUDENT"
952+
echo "ON_STUDENT=$(echo $ON_STUDENT)" >> $GITHUB_OUTPUT
953+
echo "TAG_STUDENT=$(echo $TAG_STUDENT)" >> $GITHUB_OUTPUT
954+
955+
- name: "Installing missing package"
956+
run: |
957+
sudo apt-get update
958+
sudo apt-get install -y libgomp1
959+
960+
- name: "Setup Python"
961+
uses: actions/setup-python@v5
962+
with:
963+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
964+
965+
- name: "Checking Python"
966+
run: |
967+
python --version
968+
python -m pip install --upgrade pip
969+
970+
- name: "Install ansys-mapdl-core"
971+
run: |
972+
python -m pip install . --no-deps
973+
python -m pip install -r minimum_requirements.txt
974+
python -c "from ansys.mapdl import core as pymapdl; print('Import successfull')"
975+
976+
- name: "Unit testing requirements installation"
977+
run: |
978+
python -m pip install -r .ci/requirements_minimal.txt
979+
980+
- name: "Unit testing"
981+
env:
982+
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
983+
ON_STUDENT: ${{ steps.student_check.outputs.ON_STUDENT }}
984+
run: |
985+
echo "ON_UBUNTU: $ON_UBUNTU"
986+
echo "ON_STUDENT: $ON_STUDENT"
987+
988+
# Because there is no 'ansys-tools-path' we need to input the
989+
# executable path with the env var: PYMAPDL_MAPDL_EXEC.
990+
991+
if [[ "${{ matrix.mapdl-version }}" == *"latest-ubuntu"* ]] ; then
992+
version=${{ env.LATEST_VERSION }}
993+
else
994+
version=$(echo "${{ matrix.mapdl-version }}" | head -c 5 | tail -c 4 | tr -d '.')
995+
fi;
996+
997+
echo "Version: $version"
998+
999+
export PYMAPDL_MAPDL_EXEC=/ansys_inc/v"$version"/ansys/bin/ansys"$version"
1000+
echo "$PYMAPDL_MAPDL_EXEC"
1001+
1002+
unset PYMAPDL_START_INSTANCE
1003+
pytest -k "console" \
1004+
${{ env.PYTEST_ARGUMENTS }} \
1005+
--cov-report=xml:${{ matrix.mapdl-version }}-minimal-console.xml
1006+
1007+
- name: "Collect logs on failure"
1008+
if: always()
1009+
env:
1010+
LOG_NAMES: logs-minimal-console-${{ matrix.mapdl-version }}
1011+
run: |
1012+
.ci/collect_mapdl_logs_locals.sh
1013+
1014+
- name: "Upload logs to GitHub"
1015+
if: always()
1016+
uses: actions/upload-artifact@master
1017+
with:
1018+
name: logs-minimal-console-${{ matrix.mapdl-version }}.tgz
1019+
path: ./logs-minimal-console-${{ matrix.mapdl-version }}.tgz
1020+
1021+
- name: "Display files structure"
1022+
if: always()
1023+
env:
1024+
LOG_NAMES: logs-minimal-console-${{ matrix.mapdl-version }}
1025+
run: |
1026+
.ci/display_logs_locals.sh
1027+
1028+
- uses: codecov/codecov-action@v5
1029+
name: "Upload coverage to Codecov"
1030+
with:
1031+
token: ${{ secrets.CODECOV_TOKEN }} # required
1032+
root_dir: ${{ github.workspace }}
1033+
name: ${{ matrix.mapdl-version }}-minimal-console.xml
1034+
flags: ubuntu,local,${{ matrix.mapdl-version }},minimal,console,${{ steps.student_check.outputs.TAG_STUDENT }},dmp
1035+
1036+
- name: "Upload coverage artifacts"
1037+
uses: actions/upload-artifact@v4
1038+
with:
1039+
name: ${{ matrix.mapdl-version }}-minimal-console.xml
1040+
path: ./${{ matrix.mapdl-version }}-minimal-console.xml
1041+
1042+
8681043
test-windows:
8691044
# Skipped
8701045
if: github.repository == ''

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 - 2024 ANSYS, Inc. and/or its affiliates.
3+
Copyright (c) 2016 - 2025 ANSYS, Inc. and/or its affiliates.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

doc/changelog.d/3183.changed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/changelog.d/3186.changed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)