LinkCheck - All files π #51
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: LinkCheck - All files π | |
on: | |
schedule: | |
- cron: "0 5 * * 0" # Runs at 05:00 on Sunday. | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ON_CI: True | |
DOCKER_PACKAGE: ghcr.io/ansys/mapdl | |
DOCKER_IMAGE_VERSION_DOCS_BUILD: v23.1.0 | |
MAIN_PYTHON_VERSION: '3.9' | |
PYANSYS_OFF_SCREEN: True | |
DPF_START_SERVER: False | |
DPF_PORT: 21002 | |
jobs: | |
linkchecker: | |
name: Check Links | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
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 | |
ON_DOCUMENTATION: TRUE | |
SHELLOPTS: "errexit:pipefail" | |
steps: | |
- name: "Install Git and checkout project" | |
uses: actions/checkout@v4 | |
- name: "Setup Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: "Install OS packages" | |
run: | | |
sudo apt update | |
sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk graphviz | |
- name: "Test virtual framebuffer" | |
run: | | |
pip install -r .ci/requirements_test_xvfb.txt | |
xvfb-run python .ci/display_test.py | |
- name: "Install ansys-mapdl-core" | |
run: | | |
pip install . | |
xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())" | |
- name: "Login in Github container registry" | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GH_USERNAME }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Pull, launch, and validate MAPDL service" | |
run: .ci/start_mapdl.sh | |
env: | |
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} | |
MAPDL_IMAGE: '${{ env.DOCKER_PACKAGE }}:${{ env.DOCKER_IMAGE_VERSION_DOCS_BUILD }}' | |
- name: "Retrieve PyMAPDL version" | |
id: version | |
run: | | |
echo "PYMAPDL_VERSION=$(python -c 'from ansys.mapdl.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT | |
echo "PyMAPDL version is: $(python -c "from ansys.mapdl.core import __version__; print(__version__)")" | |
- name: "Install docs build requirements" | |
run: | | |
pip install .[doc] | |
- 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: LinkCheck | |
run: | | |
xvfb-run make -C doc linkcheck SPHINXOPTS="-j auto -W --keep-going" | |
- name: "Display linkchecker results" | |
if: always() | |
run: | | |
echo "::group:: Display linkcher output" && cat doc/*/output.txt && echo "::endgroup::" || echo "Failed to display the output file." | |
- name: "Upload HTML Documentation" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: documentation-html | |
path: doc/_build/html | |
retention-days: 7 | |
- name: "Upload artifacts" | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: output | |
path: doc/**/output.txt | |
retention-days: 30 |