Skip to content

Bump sphinx from 7.1.2 to 7.2.6 in /requirements #1025

Bump sphinx from 7.1.2 to 7.2.6 in /requirements

Bump sphinx from 7.1.2 to 7.2.6 in /requirements #1025

Workflow file for this run

name: CI
on:
workflow_dispatch:
schedule: # UTC at 0300
- cron: "0 3 * * *"
pull_request:
push:
tags:
- "*"
branches:
- main
env:
MAIN_PYTHON_VERSION: '3.9'
RESET_EXAMPLES_CACHE: 0
RESET_DOC_BUILD_CACHE: 0
USE_CACHE: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
packages: read
jobs:
style:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Test with tox
run: tox -e style
doc-style:
name: Documentation Style Check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: Documentation building
needs: [style, doc-style]
runs-on: ubuntu-latest
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
DOCKER_PACKAGE: ghcr.io/ansys/pymapdl/mapdl
DOCKER_IMAGE_VERSION_DOCS_BUILD: v22.2.0
DPF_PORT: 21002
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
- name: "Set up Python using cache"
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
cache-dependency-path: 'requirements/requirements_doc.txt'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk nodejs npm graphviz
npm install -g @mermaid-js/mermaid-cli
- name: Install Python requirements
run: pip install -r requirements/requirements_doc.txt
- name: Test virtual framebuffer
run: |
xvfb-run python .ci/display_test.py
- name: Login in Github Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull, launch, and validate MAPDL service
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MAPDL_IMAGE: '${{ env.DOCKER_PACKAGE }}:${{ env.DOCKER_IMAGE_VERSION_DOCS_BUILD }}'
run: .ci/start_mapdl.sh
- name: Retrieve PyMAPDL version
run: |
echo "PYMAPDL_VERSION=$(python -c 'from ansys.mapdl.core import __version__; print(__version__)')" >> $GITHUB_ENV
echo "PyMAPDL version is: $(python -c "from ansys.mapdl.core import __version__; print(__version__)")"
id: version
- 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: "Cache Verification Manual examples"
uses: actions/cache@v3
if: ${{ env.USE_CACHE }} == 'true'
with:
path: doc/source/verif-manual
key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.PYMAPDL_VERSION }}
- name: "Cache docs build directory"
uses: actions/cache@v3
if: ${{ env.USE_CACHE }} == 'true'
with:
path: doc/_build
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.PYMAPDL_VERSION }}
- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v4
with:
requires-xvfb: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
checkout: false
skip-install: true
sphinxopts: -j auto
use-python-cache: False
- name: Upload HTML Documentation
uses: actions/upload-artifact@v3
with:
name: documentation-html
path: doc/_build/html
retention-days: 7
- name: Deploy
if: contains(github.ref, 'refs/heads/main')
uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: doc/_build/html
clean: true
single-commit: true
- name: Build PDF Documentation
working-directory: doc
run: make pdf
- name: Upload PDF Documentation
uses: actions/upload-artifact@v3
with:
name: documentation-pdf
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
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [style, doc-build] #docs-style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Zip HTML documentation
uses: vimtor/[email protected]
with:
files: documentation-html
dest: documentation-html.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
./documentation-html.zip
./documentation-pdf/*.pdf