Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
2e94e8c
Adding template files
clatapie Dec 7, 2022
ceb6293
Adding src files
clatapie Dec 7, 2022
ae6048c
Make start_mapdl.sh file executable
clatapie Dec 7, 2022
5ac581a
Removing DPF Server Activation
clatapie Dec 7, 2022
bc68652
Modifying the doc content
clatapie Dec 7, 2022
4b784f6
Modifying the related doc
clatapie Dec 7, 2022
9728675
Update doc/source/conf.py
clatapie Dec 7, 2022
9baa0d4
Reviewer comments
clatapie Dec 7, 2022
4a41757
Requirement change
clatapie Dec 7, 2022
5fb30c1
Removing scipy requirement
clatapie Dec 7, 2022
441ba52
Apply suggestions from code review
clatapie Dec 7, 2022
0fc0a2f
Adding unit tests
clatapie Dec 7, 2022
61a13bf
Merge branch 'maint/configure-repository' of https://github.com/pyans…
clatapie Dec 7, 2022
22b2449
Modifying CI/CD
clatapie Dec 7, 2022
cb33335
Fixing issues
clatapie Dec 7, 2022
80fc95e
Modifying the pipeline
clatapie Dec 7, 2022
a740a66
Update .github/workflows/ci_cd.yml
clatapie Dec 8, 2022
83a7539
Pipeline changes
clatapie Dec 8, 2022
3b6819b
add changes
clatapie Dec 8, 2022
ea6ecd3
Pipeline changes
clatapie Dec 8, 2022
6bdee11
Apply suggestions from code review
clatapie Dec 8, 2022
c7f841f
Fixing issues in the pipeline
clatapie Dec 8, 2022
3eca1f6
Merge branch 'maint/configure-repository' of https://github.com/pyans…
clatapie Dec 8, 2022
a4c809c
Code style changes
clatapie Dec 8, 2022
bde2523
Fixing document dependencies
clatapie Dec 8, 2022
a2ff673
Changes for the unit tests
clatapie Dec 8, 2022
9736ace
Changes related to pyansys/actions
clatapie Dec 8, 2022
27a642a
Fixing unit tests
clatapie Dec 8, 2022
c801179
Fixing unit tests
clatapie Dec 8, 2022
4ade022
Fixing Unit Test
clatapie Dec 8, 2022
6f55738
Fixing some math.py issues
clatapie Dec 8, 2022
ae653dd
Installing pymapdl to do the testing
clatapie Dec 13, 2022
2212103
Modifying pipeline
clatapie Dec 14, 2022
0b1cacf
Removing smoke tests and fixing setups
clatapie Dec 14, 2022
142bb28
Fixing the pipeline
clatapie Dec 14, 2022
7208826
Fixing pipeline issues
clatapie Dec 14, 2022
bc1a8d8
Adding pyansys-actions features
clatapie Dec 14, 2022
5642c9c
Fixing issues in the pipeline
clatapie Dec 14, 2022
af08af0
Fixing GH Workflows
clatapie Dec 14, 2022
4a9e553
Fixing typo
clatapie Dec 14, 2022
f1c2cb3
Changes Code Style
clatapie Dec 14, 2022
480b0d9
Typo
clatapie Dec 14, 2022
be013d0
Modifying the permission
clatapie Dec 14, 2022
b79f595
Fxing GH Workflow
clatapie Dec 14, 2022
1a96cde
Fixing a typo
clatapie Dec 14, 2022
3b4d8ee
Adding files related to Docker
clatapie Dec 14, 2022
1001cb9
Changing file permissions
clatapie Dec 14, 2022
0476a05
Removing the v22.2-ubuntu Unit Tests
clatapie Dec 14, 2022
4221b4d
Apply suggestions from code review
clatapie Dec 15, 2022
6fae946
Removing the launch_math function
clatapie Dec 15, 2022
34d749e
Apply suggestions from code review
clatapie Dec 15, 2022
1c6438a
Apply suggestions from code review
clatapie Dec 15, 2022
7bbe83d
Merge branch 'maint/configure-repository' of https://github.com/pyans…
clatapie Dec 15, 2022
ab894fe
Fixing a typo
clatapie Dec 15, 2022
1d8fcc7
Apply comments from reviewer
clatapie Dec 15, 2022
cab2539
PyAnsys code style checks
clatapie Dec 15, 2022
2852b25
Fixing an issue in GH Workflow
clatapie Dec 15, 2022
ac489f5
Fixing issues int the GH Workflow
clatapie Dec 15, 2022
2903090
Fiwing a typo
clatapie Dec 15, 2022
972eabe
Adding a dependency
clatapie Dec 15, 2022
3aa2561
Adding 404.rst file
clatapie Dec 15, 2022
29c4971
PyAnsys code style checks
clatapie Dec 15, 2022
bbb219a
Apply suggestions from code review
clatapie Dec 16, 2022
4a30cdd
Multi-versionning files
clatapie Dec 16, 2022
16df018
PyAnsys code style checks
clatapie Dec 16, 2022
e702863
Fixing multi-version feature
clatapie Dec 16, 2022
4a5ce91
Fixing typo
clatapie Dec 16, 2022
70227d4
Trying to deploy the documentation
clatapie Dec 16, 2022
73bd359
Modifying the pipeline
clatapie Dec 16, 2022
79ae222
Fixing the pipeline
clatapie Dec 16, 2022
c979b7a
Apply suggestions from reviewers
clatapie Dec 16, 2022
1dda912
Fixing doc deploy
clatapie Dec 16, 2022
993ba33
Modifying Deploy development documentation
clatapie Dec 16, 2022
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
18 changes: 18 additions & 0 deletions .ci/start_mapdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
docker pull $MAPDL_IMAGE
docker run \
--name mapdl \
--restart always \
--health-cmd="ps aux | grep \"[/]ansys_inc/.*ansys\.e.*grpc\" -q && echo 0 || echo 1" \
--health-interval=0.5s \
--health-retries=4 \
--health-timeout=0.5s \
--health-start-period=10s \
-e ANSYSLMD_LICENSE_FILE=1055@$LICENSE_SERVER \
-e ANSYS_LOCK="OFF" \
-p $PYMAPDL_PORT:50052 \
-p $PYMAPDL_DB_PORT:50055 \
$MAPDL_IMAGE \
-smp > log.txt &
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
# python -c "from ansys.mapdl.core import launch_mapdl; print(launch_mapdl())"
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
exclude = venv, __init__.py, doc/_build, .venv, doc/source/technology_showcase_examples
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
count = True
max-complexity = 10
max-line-length = 100
statistics = True
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
insecure-external-code-execution: allow
schedule:
interval: "weekly"
labels:
- "maintenance"
- "dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Documentation:
- doc/source/**/*
Maintenance:
- .github/**/*
- .flake8
- ignore_words.txt
- pyproject.toml
Dependencies:
- pyproject.toml
CI/CD:
- .github/**/*
27 changes: 27 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: bug
description: Something isn't working
color: d42a34

- name: dependencies
description: Related with project dependencies
color: ffc0cb

- name: documentation
description: Improvements or additions to documentation
color: 0677ba

- name: enhancement
description: New features or code improvements
color: FFD827

- name: good first issue
description: Easy to solve for newcomers
color: 62ca50

- name: maintenance
description: Package and maintenance related
color: f78c37

- name: release
description: Anything related to an incoming release
color: ffffff
241 changes: 241 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# check spelling, codestyle
name: GitHub CI

# run only on main branch. This avoids duplicated actions on PRs
on:
workflow_dispatch:
schedule: # UTC at 0300
- cron: "0 3 * * *"
pull_request:
push:
tags:
- "*"
branches:
- main

env:
MAIN_PYTHON_VERSION: '3.9'
PACKAGE_NAME: 'ansys-math-core'
DOCKER_PACKAGE: ghcr.io/pyansys/pymapdl/mapdl
DOCKER_IMAGE_VERSION_DOCS_BUILD: v22.2.0
RESET_PIP_CACHE: 0
DOCUMENTATION_CNAME: 'math.docs.pyansys.com'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

code-style:
name: "Code style"
runs-on: ubuntu-latest
steps:
- name: PyAnsys code style checks
uses: pyansys/actions/code-style@v2
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}


doc-style:
name: "Documentation Style Check"
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: pyansys/actions/doc-style@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}


build_test:
name: "Build and unit testing"
runs-on: ubuntu-latest
needs: [doc-style, code-style]
strategy:
matrix:
mapdl-version: ['v21.1.1', 'v21.2.1', 'v22.1.0', 'v22.2.0'] #'v22.2-ubuntu'
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v3

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install os packages"
run: |
sudo apt update

- name: "Cache pip"
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.mapdl-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.mapdl-version }}

- name: Install ansys-mapdl-core
run: |
python -m pip install ansys-mapdl-core

# - name: Install ansys-math-core
# run: |
# python -m pip install build
# python -m build
# python -m pip install dist/*.whl
# xvfb-run python -c "from ansys.math import core as amath; print(amath.Report())"

- name: "Login in Github container registry"
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Pull, launch, and validate MAPDL service"
run: .ci/start_mapdl.sh
if: ${{ !contains( matrix.mapdl-version, 'ubuntu') }}
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MAPDL_IMAGE: ${{ env.DOCKER_PACKAGE }}:${{ matrix.mapdl-version }}


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

- name: "Unit testing"
run: |
pytest -v --durations=10 --maxfail=10 --reruns 7 --reruns-delay 3 --only-rerun MapdlExitedError --only-rerun EmptyRecordError --cov=ansys.mapdl.core --cov-report=xml --cov-report=html

- uses: codecov/codecov-action@v3
name: "Upload coverage to Codecov"

# - name: "Check package"
# run: |
# pip install twine
# twine check dist/*

- name: "Upload wheel and binaries"
uses: actions/upload-artifact@v3
with:
name: Ansys-Math-packages
path: dist/
retention-days: 7

- name: "Display files structure"
if: always()
run: |
mkdir logs-${{ matrix.mapdl-version }} && echo "Successfully generated directory ${{ matrix.mapdl-version }}"
echo "::group:: Display files structure" && ls -R && echo "::endgroup::"
ls -R > ./logs-${{ matrix.mapdl-version }}/files_structure.txt

- name: "Display docker files structures"
if: always()
run: |
echo "::group:: Display files structure" && docker exec mapdl /bin/bash -c "ls -R" && echo "::endgroup::"
docker exec mapdl /bin/bash -c "ls -R" > ./logs-${{ matrix.mapdl-version }}/docker_files_structure.txt

- name: "Collect MAPDL logs on failure"
if: ${{ always() && !contains( matrix.mapdl-version, 'ubuntu') }}
run: |
docker exec mapdl /bin/bash -c "mkdir -p /mapdl_logs && echo 'Successfully created directory inside docker container'"
docker exec mapdl /bin/bash -c "if compgen -G 'file*.out' > /dev/null ;then cp -f /file*.out /mapdl_logs && echo 'Successfully copied out files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G 'file*.err' > /dev/null ;then cp -f /file*.err /mapdl_logs && echo 'Successfully copied err files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G 'file*.log' > /dev/null ;then cp -f /file*.log /mapdl_logs && echo 'Successfully copied log files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G '*.crash' > /dev/null ;then cp -f /*.crash /mapdl_logs && echo 'Successfully copied crash files.'; fi"
docker cp mapdl:/mapdl_logs/. ./logs-${{ matrix.mapdl-version }}/.


- name: "Collect MAPDL logs on failure for ubuntu image"
if: ${{ always() && contains( matrix.mapdl-version,'ubuntu') }}
run: |
docker exec mapdl /bin/bash -c "mkdir -p /mapdl_logs && echo 'Successfully created directory inside docker container'"
docker exec mapdl /bin/bash -c "if compgen -G '/jobs/file*.out' > /dev/null ;then cp -f /jobs/file*.out /mapdl_logs && echo 'Successfully copied out files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G '/jobs/file*.err' > /dev/null ;then cp -f /jobs/file*.err /mapdl_logs && echo 'Successfully copied err files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G '/jobs/file*.log' > /dev/null ;then cp -f /jobs/file*.log /mapdl_logs && echo 'Successfully copied log files.'; fi"
docker exec mapdl /bin/bash -c "if compgen -G '/jobs/*.crash' > /dev/null ;then cp -f /jobs/*.crash /mapdl_logs && echo 'Successfully copied crash files.'; fi"
docker cp mapdl:/mapdl_logs/. ./logs-${{ matrix.mapdl-version }}/.

- name: "Tar logs"
if: always()
run: |
cp log.txt ./logs-${{ matrix.mapdl-version }}/log.txt
tar cvzf ./logs-${{ matrix.mapdl-version }}.tgz ./logs-${{ matrix.mapdl-version }}

- name: "Upload logs to GitHub"
if: always()
uses: actions/upload-artifact@master
with:
name: logs-${{ matrix.mapdl-version }}.tgz
path: ./logs-${{ matrix.mapdl-version }}.tgz

- name: "Display MAPDL Logs"
if: always()
run: cat log.txt

- name: "List main files"
if: always()
run: |
if compgen -G './logs-${{ matrix.mapdl-version }}/*.err' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.err; do echo "::group:: Error file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-${{ matrix.mapdl-version }}/*.log' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.log; do echo "::group:: Log file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-${{ matrix.mapdl-version }}/*.out' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.out; do echo "::group:: Output file $f" && cat $f && echo "::endgroup::" ; done; fi


doc-build:
name: Doc building
runs-on: ubuntu-latest
needs: [build_test]
steps:
- name: "Run Ansys documentation building action"
uses: pyansys/actions/doc-build@v2
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}


doc-deploy-dev:
name: "Deploy development documentation"
# Deploy development only when merging to main
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: doc-build
steps:
- name: "Deploy the latest documentation"
uses: pyansys/actions/doc-deploy-dev@v2
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}


doc-deploy-stable:
name: "Deploy stable documentation"
# Deploy release documentation when creating a new tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: doc-build
steps:
- name: "Deploy the stable documentation"
uses: pyansys/actions/doc-deploy-stable@v2
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}


release:
name: "Release project to private PyPI, public PyPI and GitHub"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build_test, doc-deploy-stable]
runs-on: ubuntu-latest
steps:

- name: "Release to GitHub"
uses: pyansys/actions/release-github@v1
with:
library-name: ${{ env.PACKAGE_NAME }}
Loading