Skip to content

Commit

Permalink
Merge branch 'main' into release/0.63
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Sep 2, 2022
2 parents 8f6535c + 0a64c81 commit b7d69a0
Show file tree
Hide file tree
Showing 74 changed files with 3,284 additions and 1,152 deletions.
16 changes: 15 additions & 1 deletion .ci/start_mapdl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash
docker pull $MAPDL_IMAGE
docker run -e ANSYSLMD_LICENSE_FILE=1055@$LICENSE_SERVER --restart always --name mapdl -p $PYMAPDL_PORT:50052 -p $PYMAPDL_DB_PORT:50055 $MAPDL_IMAGE -smp > log.txt &
docker run \
--restart always \
--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 ANS_DEBUG_CRASH=1 \
-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())"
16 changes: 15 additions & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ body:
required: true
- label: I am using a Python virtual environment
required: true
- label: I have a fully updated virtual environment (i.e. ``pip install --upgrade --upgrade-strategy eager ansys-mapdl-core``)
required: true

- type: textarea
id: bug-description
Expand Down Expand Up @@ -62,7 +64,7 @@ body:
- 'MacOS'
- 'Linux'
validations:
required: true
required: false

- type: dropdown
id: python-version
Expand All @@ -75,6 +77,18 @@ body:
- '3.8'
- '3.9'
- '3.10'
validations:
required: false

- type: textarea
id: pymapdl-report
attributes:
label: PyMAPDL Report
description: Run `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` to get the PyMAPDL Report
placeholder: |
```text
Paste the output of `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` here
```
validations:
required: true

Expand Down
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ updates:
ignore:
- dependency-name: "vtk"
- dependency-name: "grpcio"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
155 changes: 123 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ env:
# You should go up in number, if you go down (or repeat a previous value)
# you might end up reusing a previous cache if it haven't been deleted already.
# It applies 7 days retention policy by default.
RESET_PIP_CACHE: 2
RESET_EXAMPLES_CACHE: 2
RESET_DOC_BUILD_CACHE: 2
RESET_AUTOSUMMARY_CACHE: 2
RESET_PIP_CACHE: 5
RESET_EXAMPLES_CACHE: 5
RESET_DOC_BUILD_CACHE: 5
RESET_AUTOSUMMARY_CACHE: 5
PACKAGE_NAME: PyMAPDL

concurrency:
Expand All @@ -37,9 +37,9 @@ jobs:
name: Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4.2.0
with:
python-version: 3.9
- name: Install pre-commit
Expand All @@ -56,15 +56,15 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Linux pip cache
uses: actions/cache@v2
uses: actions/cache@v3
if: ${{ runner.os == 'Linux' }}
with:
path: ~/.cache/pip
Expand All @@ -73,7 +73,7 @@ jobs:
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}
- name: Window pip cache
uses: actions/cache@v2
uses: actions/cache@v3
if: ${{ runner.os == 'Windows' }}
with:
path: ~\AppData\Local\pip\Cache
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYMAPDL_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip

- name: Upload Wheelhouse
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYMAPDL_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}
path: '*.zip'
Expand All @@ -115,7 +115,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# used for documentation deployment
- name: Get Bot Application Token
Expand All @@ -127,7 +127,7 @@ jobs:
application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }}

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4.2.0
with:
python-version: 3.8

Expand All @@ -137,7 +137,7 @@ jobs:
sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements/requirements_docs*.txt') }}
Expand All @@ -157,7 +157,7 @@ jobs:
xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"
- name: Login in Github Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
Expand All @@ -176,23 +176,23 @@ jobs:
id: version

- name: Cache examples
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: doc/source/examples
key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}
- name: Cache docs build directory
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: doc/build
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}
- name: Cache autosummary
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: doc/source/**/_autosummary/*.rst
key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYMAPDL_VERSION }}-${{ github.sha }}
Expand All @@ -213,7 +213,7 @@ jobs:
zip -r PyMAPDL_documentation.zip *
- name: Upload HTML Documentation
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: HTML-Documentation
path: doc/build/html/PyMAPDL_documentation.zip
Expand All @@ -225,34 +225,82 @@ jobs:
with:
repository-name: pyansys/pymapdl-docs
token: ${{ steps.get_workflow_token.outputs.token }}
BRANCH: gh-pages
FOLDER: doc/build/html
CLEAN: true
branch: gh-pages
folder: doc/build/html
clean: true

- name: Build PDF Documentation
working-directory: doc
run: make pdf

- name: Upload PDF Documentation
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: PDF-Documentation
path: doc/build/latex/pymapdl*.pdf
retention-days: 7

- name: Display files structure
if: always()
run: |
mkdir logs-build-docs
echo "::group:: Display files structure" && ls -R && echo "::endgroup::"
ls -R > ./logs-build-docs/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-build-docs/docker_files_structure.txt
- name: Collect MAPDL logs on failure
if: always()
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-build-docs/.
- name: Tar logs
if: always()
run: |
cp -f doc/build/latex/*.log ./logs-build-docs/
cp log.txt ./logs-build-docs/
tar cvzf ./logs-build-docs.tgz ./logs-build-docs
- name: Upload logs to GitHub
if: always()
uses: actions/upload-artifact@master
with:
name: logs-build-docs.tgz
path: ./logs-build-docs.tgz

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

- name: List main files
if: always()
run: |
if compgen -G 'doc/build/latex/*.log' > /dev/null ;then for f in doc/build/latex/*.log; do echo "::group:: Output latex log file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-build-docs/*.err' > /dev/null ;then for f in ./logs-build-docs/*.err; do echo "::group:: Error file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-build-docs/*.log' > /dev/null ;then for f in ./logs-build-docs/*.log; do echo "::group:: Log file $f" && cat $f && echo "::endgroup::" ; done; fi
if compgen -G './logs-build-docs/*.out' > /dev/null ;then for f in ./logs-build-docs/*.out; do echo "::group:: Output file $f" && cat $f && echo "::endgroup::" ; done; fi
build_test:
name: Build and Unit Testing
needs: testimport
runs-on: ubuntu-latest
strategy:
matrix:
mapdl-version: ['v21.1.1', 'v21.2.1', 'v22.1.0', 'v22.2.0']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4.2.0
with:
python-version: 3.8

Expand All @@ -262,7 +310,7 @@ jobs:
sudo apt install libgl1-mesa-glx xvfb
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements/requirements_tests.txt') }}
Expand All @@ -282,7 +330,7 @@ jobs:
xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"
- name: Login in Github Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
Expand All @@ -299,7 +347,7 @@ jobs:
pip install -r requirements/requirements_tests.txt
xvfb-run pytest -v --durations=0 --cov=ansys.mapdl.core --cov-report=xml --cov-report=html
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
if: matrix.mapdl-version == 'v21.2.1'
name: 'Upload coverage to Codecov'

Expand All @@ -309,27 +357,70 @@ jobs:
twine check dist/*
- name: Upload wheel and binaries
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: PyMAPDL-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()
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: 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
Release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [docs_build, build_test]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4.2.0
with:
python-version: 3.9

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R
Expand Down
Loading

0 comments on commit b7d69a0

Please sign in to comment.