Bump sphinx-autoapi from 3.3.2 to 3.3.3 #807
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub CI | |
on: | |
merge_group: | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
env: | |
MAIN_PYTHON_VERSION: '3.10' | |
MAPDL_DOCKER_PACKAGE: 'ghcr.io/ansys/pymapdl/mapdl' | |
MAPDL_DOCKER_VERSION: 'v23.1.0' | |
DOCUMENTATION_CNAME: "manager.materials.docs.pyansys.com" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
style: | |
name: Code style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip poetry tox | |
poetry config installer.modern-installation false | |
- name: Test with tox | |
run: tox -e style | |
docs-style: | |
name: Documentation Style Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Running Vale | |
uses: errata-ai/vale-action@reviewdog | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
files: doc | |
reporter: github-pr-check | |
level: error | |
filter_mode: nofilter | |
fail_on_error: true | |
vale_flags: "--config=doc/.vale.ini" | |
smoke-tests: | |
name: Build and Smoke tests | |
runs-on: ${{ matrix.os }} | |
needs: [style] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11'] | |
steps: | |
- name: Build wheelhouse and perform smoke test | |
uses: ansys/actions/build-wheelhouse@v8 | |
with: | |
library-name: "ansys-materials-manager" | |
library-namespace: "ansys.materials.manager" | |
operating-system: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
tests: | |
name: Tests and coverage | |
runs-on: ${{ matrix.os }} | |
needs: [smoke-tests] | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
python-version: ['3.10'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip poetry tox tox-gh-actions | |
poetry config installer.modern-installation false | |
- name: Test with tox | |
# Only the tox environment specified in the tox.ini gh-actions is run | |
run: tox -e py310-coverage | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
mapdl-integration-tests: | |
name: Integration tests with MAPDL | |
runs-on: ubuntu-latest | |
needs: style | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Python ${{ env.MAIN_PYTHON_VERSION }}" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --upgrade pip poetry tox tox-gh-actions | |
poetry config installer.modern-installation false | |
- name: "Login in Github container registry" | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Start MAPDL" | |
run: | | |
MAPDL_IMAGE="${{ env.MAPDL_DOCKER_PACKAGE }}:${{ env.MAPDL_DOCKER_VERSION }}" | |
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@${{ secrets.LICENSE_SERVER }} \ | |
-e ANSYS_LOCK="OFF" \ | |
-p 50052:50052 \ | |
-p 50055:50055 \ | |
$MAPDL_IMAGE \ | |
-smp -np 2 > log.txt & | |
grep -q 'Server listening on' <(timeout 60 tail -f log.txt) | |
- name: "Test with tox" | |
# Only the tox environment specified in the tox.ini gh-actions is run | |
run: tox -e py310-coverage -- -m mapdl_integration | |
- 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" | |
mkdir ./mapdl_logs | |
docker cp mapdl:/mapdl_logs/. ./mapdl_logs/. | |
- name: "Tar logs" | |
if: always() | |
run: | | |
cp log.txt ./mapdl_logs/ | |
tar cvzf ./mapdl_logs.tgz ./mapdl_logs | |
- name: "Upload logs to GitHub" | |
if: always() | |
uses: actions/upload-artifact@master | |
with: | |
name: mapdl_logs.tgz | |
path: ./mapdl_logs.tgz | |
- name: "Display MAPDL Logs" | |
if: always() | |
run: cat log.txt | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
needs: docs-style | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip poetry tox | |
poetry config installer.modern-installation false | |
- name: Generate the documentation with tox | |
run: tox -e doc | |
- name: Upload HTML Documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: documentation-html | |
path: .tox/doc_out/ | |
retention-days: 7 | |
build: | |
name: Build library | |
runs-on: ubuntu-latest | |
needs: [docs, tests, mapdl-integration-tests] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: Install dependencies and build the library | |
run: | | |
python -m pip install --upgrade pip poetry | |
poetry config installer.modern-installation false | |
poetry install | |
poetry build | |
poetry run twine check dist/* | |
- name: Upload wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
path: dist/ | |
retention-days: 7 | |
upload_dev_docs: | |
name: Upload dev documentation | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Deploy the latest documentation | |
uses: ansys/actions/doc-deploy-dev@v8 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-artifact-name: "documentation-html" | |
release: | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: List directory structure | |
run: ls -R | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m pip install --upgrade pip twine | |
python -m twine upload --skip-existing ./**/*.whl | |
python -m twine upload --skip-existing ./**/*.tar.gz | |
- name: Release to GitHub | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
./**/*.whl | |
./**/*.zip | |
./**/*.tar.gz | |
upload_docs_release: | |
name: "Upload release documentation" | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Deploy the stable documentation | |
uses: ansys/actions/doc-deploy-stable@v8 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} |