Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
efad1ba
feat: add GitHub Action for testing PyMAPDL with remote MAPDL instances
germa89 Mar 6, 2025
53f97ca
chore: adding changelog file 3785.maintenance.md [dependabot-skip]
pyansys-ci-bot Mar 6, 2025
55e4808
fix: update GitHub Action to use default branch for remote testing
germa89 Mar 6, 2025
dd7feca
Merge branch 'ci/use-pymapdl-actions' of https://github.com/ansys/pym…
germa89 Mar 6, 2025
f7463dc
feat: using file path
germa89 Mar 6, 2025
d1a20bc
fix: remove unused outputs from CI workflow
germa89 Mar 6, 2025
8e76c83
fix: restore Git installation step in CI workflow
germa89 Mar 6, 2025
c5bab06
fix: set default shell to bash in GitHub Action for remote testing
germa89 Mar 6, 2025
ac14910
fix: enforce bash shell for all steps in remote testing action
germa89 Mar 6, 2025
035a598
ci: adding actions for local, windows, and summary.
germa89 Mar 6, 2025
4db1090
fix: update conditionals for minimal input in local testing action
germa89 Mar 6, 2025
c7bf5c0
feat: add GitHub Actions for Julia testing, remote matrix build, and …
germa89 Mar 6, 2025
9989177
feat: add minimal OS package installation and adjust pytest command b…
germa89 Mar 6, 2025
4ab1f95
fix: enforce bash shell for all steps in build and test actions
germa89 Mar 6, 2025
a0e2e7a
feat: add output matrix for MAPDL containers in build matrix action
germa89 Mar 6, 2025
ca7e7eb
fix: remove unnecessary blank lines in action YAML files and set matr…
germa89 Mar 6, 2025
166e63f
feat: remove if condition, add type_event input to build-matrix actio…
germa89 Mar 6, 2025
b8cdf95
Merge branch 'main' into ci/use-pymapdl-actions
germa89 Mar 6, 2025
e2cb730
feat: using reusable workflows instead
germa89 Mar 6, 2025
ed73d6d
chore: adding changelog file 3787.maintenance.md [dependabot-skip]
pyansys-ci-bot Mar 6, 2025
0df4eb0
fix: update latest-version to 252 in CI workflow
germa89 Mar 6, 2025
2fa7c2b
Merge branch 'ci/using-reusable-workflows' of https://github.com/ansy…
germa89 Mar 6, 2025
6659ce6
fix: update CI workflow to use 'username' instead of 'actor' and adju…
germa89 Mar 6, 2025
54a8c19
fix: correct variable reference for latest-version in test-local work…
germa89 Mar 6, 2025
98ca1e6
fix: remove unused main-python-version input from test-local workflow
germa89 Mar 6, 2025
aff9e35
fix: update test-local workflow to streamline input parameters and im…
germa89 Mar 6, 2025
dbcb806
fix: add directory listing to test-remote workflow for better debugging
germa89 Mar 6, 2025
0a16b01
fix: tests
germa89 Mar 6, 2025
ce3ec83
fix: add pytest arguments to enhance test execution and reporting
germa89 Mar 6, 2025
dfbeba6
fix: remove some composite actions
germa89 Mar 6, 2025
6ee5f5c
fix: update password secret reference in test-local workflow
germa89 Mar 6, 2025
f0915b9
fix: rename password secret to token in CI workflows for clarity
germa89 Mar 6, 2025
d23282f
fix: add step to install Git and checkout project in doc-build workflow
germa89 Mar 6, 2025
3f59aca
fix: standardize license server secret naming in workflows
germa89 Mar 6, 2025
eccbfbb
fix: standardize license server secret naming in CI workflow
germa89 Mar 7, 2025
d2bb911
fix: add MAPDL package and environment variables in test-remote workflow
germa89 Mar 7, 2025
d288db4
fix: update CI workflows to use reusable workflows for minimal and co…
germa89 Mar 7, 2025
d386907
fix: add MAPDL package environment variable to doc-build and test-rem…
germa89 Mar 7, 2025
3352e7e
fix: update CI workflows to standardize environment variables and imp…
germa89 Mar 7, 2025
296c716
fix: update CI workflow dependencies for minimal and console jobs
germa89 Mar 7, 2025
f1fd9bb
fix: remove obsolete changelog entry for PyMAPDL GitHub Action
germa89 Mar 7, 2025
76d6323
chore: adding changelog file 3787.maintenance.md [dependabot-skip]
pyansys-ci-bot Mar 7, 2025
85f164e
fix: specify Python version for Pytest-summary action in CI workflow
germa89 Mar 7, 2025
3afebc5
Merge branch 'ci/using-reusable-workflows' of https://github.com/ansy…
germa89 Mar 7, 2025
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
79 changes: 79 additions & 0 deletions .github/actions/build-matrix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "Build remote matrix for testing"

description: |
This action builds the matrix for remote testing of PyMAPDL.

inputs:
token_teams_user_read:
description: |
Token for reading user teams.
required: true
type: string

local:
description: |
If true, the building matrix for local testing
required: false
type: boolean
default: true

run_all_builds:
description: |
If true, run all extended MAPDL build tests.
required: false
type: boolean
default: false

type_event:
description: |
Type of event that triggered the workflow.
required: false
type: string
default: ""

outputs:
matrix:
description: "Matrix of MAPDL containers to test."
value: ${{ steps.set-matrix.outputs.matrix }}

runs:
using: "composite"
steps:
- name: Get event type and user to check permissions.
id: get_user
env:
type_event: ${{ inputs.type_event }}
shell: bash
run: |
if [[ $type_event ]]; then
echo "Event type: $type_event"
echo "event_type=$( echo "$type_event" )" >> $GITHUB_OUTPUT
export user=${{ github.event.pull_request.user.login }}
else
export user=${{ github.actor }}
fi
echo "This PR has been opened by: $user"
echo "user=$( echo "$user" )" >> $GITHUB_OUTPUT

- uses: tspascoal/get-user-teams-membership@v3
id: is_organization_member
if: ${{ github.actor != 'dependabot[bot]' }}
with:
username: ${{ steps.get_user.outputs.user }}
organization: ansys
team: 'pymapdl-developers'
GITHUB_TOKEN: ${{ inputs.token_teams_user_read }}

- id: set-matrix
env:
auth_user: ${{ steps.is_organization_member.outputs.isTeamMember == 'true' || github.actor == 'dependabot[bot]' }}
ON_REMOTE: ${{ inputs.local == 'false' }}
ONLY_UBUNTU: ${{ inputs.local == 'true' }}
ON_SCHEDULE: ${{ github.event_name == 'schedule' }}
ON_WORKFLOW_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }}
RUN_ALL_TEST: ${{ inputs.run_all_builds == 'true' }}
ON_PUSH: ${{ github.event_name == 'push' }}
HAS_TAG: ${{ contains(github.ref, 'refs/tags') }}
LIMIT_VERSIONS: 2
shell: bash
run: .ci/build_matrix.sh
63 changes: 63 additions & 0 deletions .github/actions/pytest-summary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

name: |
Pytest summary

description: |
This action summarizes the duration of the tests and the standard deviation for all the jobs.

inputs:
python-version:
description: |
Python version to use.
required: true
type: string

runs:
using: "composite"

steps:

- name: "Setup Python with cache"
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: ${{ inputs.python-version }}

- name: "Install numpy"
shell: bash
run: python -m pip install numpy click

- name: "Download artifacts"
uses: actions/download-artifact@v4
with:
path: "artifacts"

- name: "List directories"
shell: bash
run: |
echo "::group:: List directories:" && ls -Rla artifacts && echo "::endgroup::"

- name: "Uncompress files"
shell: bash
run: |
find . -mindepth 1 -maxdepth 4 -type f -name 'logs-*.tgz' -exec tar -xzvf {} -C $(dirname {}) \;

- name: "List directories"
shell: bash
run: |
echo "::group:: List directories:" && ls -Rla . && echo "::endgroup::"

- name: "Create summary"
shell: bash
run: |
echo "# Test summary 🚀" >> $GITHUB_STEP_SUMMARY
echo -e "The followin tables show a summary of tests duration and standard desviation for all the jobs.\n" >> $GITHUB_STEP_SUMMARY
python .ci/pytest_summary.py --num 10 --save-file tests_durations.json >> summary.md
echo "$(cat summary.md)" >> $GITHUB_STEP_SUMMARY
cat summary.md

- name: "Upload tests summary"
uses: actions/upload-artifact@v4
with:
name: tests_durations.json
path: tests_durations.json
38 changes: 38 additions & 0 deletions .github/actions/test-julia/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Julia testing"

description: |
This action tests that PyMAPDL can be imported on Julia environments.

inputs:
julia-version:
description: |
Julia version to test.
required: true
type: string

runs:
using: "composite"
steps:
- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}

- name: "Getting python interpreter"
id: get_python
shell: bash
run: |
pycallpython=$(julia -e 'using Pkg;Pkg.add("PyCall");using PyCall;println(PyCall.python)')
echo "pythonpath=$(echo $pycallpython)" >> $GITHUB_OUTPUT

- name: "Installing PyMAPDL"
env:
PYTHON_PATH: ${{ steps.get_python.outputs.pythonpath }}
shell: bash
run: |
"$PYTHON_PATH" -m pip install -e .

- name: "Starting Julia"
shell: julia {0}
run: |
using Pkg; Pkg.add("PyCall");using PyCall;pymapdl = pyimport("ansys.mapdl.core");print(pymapdl.__version__)
82 changes: 82 additions & 0 deletions .github/actions/test-windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

name: |
Test Windows

description: |
This action runs PyMAPDL tests on Windows

inputs:

# Required inputs

codecov_token:
description: |
Token for Codecov.
required: true
type: string

runs:
using: "composite"
steps:

# Skipping because it is installed locally.
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.9

- name: "Checking Python"
shell: powershell
run: |
python -m pip install --upgrade pip

- name: "Creating python venv"
shell: powershell
run: |
python -m venv .\.venv
.\.venv\Scripts\activate

- name: "Install ansys-mapdl-core"
shell: powershell
run: |
python -m pip install build
python -m build
$FILE_=Resolve-Path '.\dist\*.whl'
python -m pip install $FILE_.Path --upgrade
python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"

- name: "Unit testing requirements installation"
shell: powershell
run: |
python -m pip install .[tests]

# - name: DPF Server Activation
# run: |
# docker pull ghcr.io/ansys/dpf-core:22.2dev
# docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}."

- name: "Unit testing"
shell: powershell
env:
file_name: windows-v22.2.0-local
run: |
set PYMAPDL_PORT=
set PYMAPDL_START_INSTANCE=
python -m pytest -k "not test_database and not test_dpf" \
${{ env.PYTEST_ARGUMENTS }} \
--ignore_image_cache \
--report-log=$file_name.jsonl \
--cov-report=xml:$file_name.xml

- uses: codecov/codecov-action@v5
name: "Upload coverage to Codecov"
with:
token: ${{ inputs.codecov_token }} # required
name: windows-v22.2.0-local.xml
flags: windows,local,v22.2.0

- name: "Upload coverage artifacts"
uses: actions/upload-artifact@v4
with:
name: windows-v22.2.0-local.xml
path: ./windows_local.xml
Loading