Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running doc builds on sphinx-ci image #2867

Closed
18 changes: 18 additions & 0 deletions .ci/install_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
echo "Adding Docker's official GPG key..."
apt-get update -y
apt-get install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

echo "Adding the repository to Apt sources..."
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null

echo "Installing..."
apt-get update -y

apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
7 changes: 3 additions & 4 deletions .ci/waiting_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ done
echo "::endgroup::"
echo "MAPDL service is up!"

echo "::group:: Waiting for the DPF port to be open..."
while ! nc -z localhost "$DPF_PORT"; do
sleep 0.1
done
echo "::group:: Waiting for the DPF port to be open..."
timeout 5m bash -c "while ! nc -z localhost $DPF_PORT; do sleep 1 done"

echo "::endgroup::"
echo "DPF service is up!"
30 changes: 21 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,23 @@ jobs:
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE
ON_DOCUMENTATION: TRUE

container:
image: ghcr.io/sphinx-doc/sphinx-ci

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

- name: Installing docker
run: |
chmod +x .ci/install_docker.sh
./.ci/install_docker.sh

- name: Test docker
run: |
docker version

- name: "Login in Github container registry"
uses: docker/login-action@v3.0.0
with:
Expand All @@ -127,7 +140,6 @@ jobs:
- name: "Pull, launch, and validate MAPDL service"
id: start_mapdl
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
MAPDL_VERSION: ${{ env.MAPDL_IMAGE_VERSION_DOCS_BUILD }}
DISTRIBUTED_MODE: "dmp"
run: |
Expand Down Expand Up @@ -167,17 +179,17 @@ jobs:

- name: "Install OS packages"
run: |
sudo apt update
sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk graphviz texlive-xetex texlive-fonts-extra qpdf texlive-xetex xindy
apt update
apt install -y zip pandoc libgl1-mesa-glx xvfb latexmk qpdf xindy netcat

- name: "Test virtual framebuffer"
run: |
pip install -r .ci/requirements_test_xvfb.txt
python -m pip install -r .ci/requirements_test_xvfb.txt
xvfb-run python .ci/display_test.py

- name: "Install ansys-mapdl-core"
run: |
pip install .
python -m pip install .
xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"

- name: "Retrieve PyMAPDL version"
Expand Down Expand Up @@ -215,7 +227,7 @@ jobs:

- name: "Install docs build requirements"
run: |
pip install .[doc]
python -m pip install .[doc]

- name: "Waiting for the services to be up"
run: |
Expand Down Expand Up @@ -392,7 +404,7 @@ jobs:

- name: "Test virtual framebuffer"
run: |
pip install -r .ci/requirements_test_xvfb.txt
python -m pip install -r .ci/requirements_test_xvfb.txt
xvfb-run python .ci/display_test.py

- name: Install ansys-mapdl-core
Expand Down Expand Up @@ -435,8 +447,8 @@ jobs:

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

- name: "Upload wheel and binaries"
uses: actions/upload-artifact@v4
Expand Down
Loading