testing: fix of doc-build action #1124
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: | |
schedule: | |
- cron: '0 0 * * *' | |
pull_request: | |
push: | |
tags: | |
- "*" | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
MAIN_PYTHON_VERSION: '3.12' | |
PACKAGE_NAME: 'ansys-sound-core' | |
DOCUMENTATION_CNAME: 'sound.docs.pyansys.com' | |
ANSRV_DPF_SOUND_IMAGE_WINDOWS_TAG: ghcr.io/ansys/ansys-sound:latest | |
ANSRV_DPF_SOUND_PORT: 6780 | |
DPF_SOUND_CONT_NAME: ansys-sound-core | |
jobs: | |
doc-build: | |
name: "Building library documentation windows" | |
runs-on: [self-hosted, Windows, pyansys-sound] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
- name: "Create Python venv" | |
run: | | |
python -m venv .venv | |
.\.venv\Scripts\Activate.ps1 | |
- name: "Install packages for documentation building" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install --upgrade pip | |
pip install --upgrade build wheel | |
pip install .[doc] | |
- name: "Login to GitHub Container Registry" | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Download DPF-Sound service container" | |
run: docker pull $env:ANSRV_DPF_SOUND_IMAGE_WINDOWS_TAG | |
- name: "Start DPF-Sound service and verify start" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
docker run -d --name ${{ env.DPF_SOUND_CONT_NAME }} -e "ANSYS_DPF_ACCEPT_LA=Y" -e "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" -v $env:LOCALAPPDATA\Ansys\ansys_sound_core\examples:C:\data -p ${{ env.ANSRV_DPF_SOUND_PORT }}:50052 --dns '8.8.8.8' ${{ env.ANSRV_DPF_SOUND_IMAGE_WINDOWS_TAG }} | |
python -c "from ansys.sound.core.server_helpers import validate_dpf_sound_connection; validate_dpf_sound_connection()" | |
- name: "Run Ansys documentation building action" | |
uses: ansys/actions/doc-build@fix/inconsistent-behavior | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
skip-install: true | |
sphinxopts: -j auto -W --keep-going | |
- name: "Stop the DPF-Sound service" | |
if: always() | |
run: | | |
docker stop $env:DPF_SOUND_CONT_NAME | |
docker logs $env:DPF_SOUND_CONT_NAME | |
docker rm $env:DPF_SOUND_CONT_NAME | |
- name: "Stop any remaining containers" | |
if: always() | |
run: | | |
$dockerContainers = docker ps -a -q | |
if (-not [string]::IsNullOrEmpty($dockerContainers)) { | |
docker stop $dockerContainers | |
docker rm $dockerContainers | |
} | |
doc-build-linux: | |
name: "Building library documentation linux" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Run Ansys documentation building action" | |
uses: ansys/actions/doc-build@fix/inconsistent-behavior | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
skip-install: true | |
sphinxopts: -j auto -W --keep-going | |
tests-pytest: | |
name: "tests-pytest" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "tests-pytest" | |
uses: ansys/actions/tests-pytest@fix/inconsistent-behavior | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
code-style: | |
name: "code-style" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "code-style" | |
uses: ansys/actions/code-style@fix/inconsistent-behavior | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
check-vulnerabilities: | |
name: "check-vulnerabilities" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "check-vulnerabilities" | |
uses: ansys/actions/check-vulnerabilities@fix/inconsistent-behavior | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |