maint: modifying CICD #20
Workflow file for this run
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.10' | |
ANSRV_DPF_SOUND_IMAGE: 'ghcr.io/ansys-internal/pydpf-sound' | |
ANSRV_DPF_SOUND_IMAGE_WINDOWS_TAG: ghcr.io/ansys-internal/pydpf-sound/ansys-dpf-sound:latest | |
ANSRV_DPF_SOUND_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} | |
DPF_SOUND_CONT_NAME: ansys-dpf-sound | |
RESET_IMAGE_CACHE: 0 | |
jobs: | |
code-style: | |
name: "Running code style checks" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Run PyAnsys code style checks" | |
uses: ansys/actions/[email protected] | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
doc-style: | |
name: "Running documentation style checks" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Running documentation style checks" | |
uses: ansys/actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
doc-build: | |
name: "Building library documentation" | |
runs-on: [self-hosted, Windows, pydpfsound] | |
needs: doc-style | |
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: "Create Python venv and activate it" | |
run: | | |
python -m venv .venv | |
.\.venv\Scripts\Activate.ps1 | |
- name: "Install packages for documentation build" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
pip install --upgrade pip | |
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 --detach --name ${{ env.DPF_SOUND_CONT_NAME }} -e ANSYS_DPF_ACCEPT_LA=Y -e ANSYSLMD_LICENSE_FILE=${{ env.ANSRV_DPF_SOUND_LICENSE_SERVER }} -dp 38521:50052 $env:ANSRV_DPF_SOUND_IMAGE_WINDOWS_TAG --entrypoint powershell | |
python -c "from ansys.dpf.sound.connect import validate_dpf_sound; validate_dpf_sound()" | |
- name: "Run Ansys documentation building action" | |
uses: ansys/actions/doc-build@v5 | |
with: | |
python-version: ${{ env.MAIN_PYTHON_VERSION }} | |
checkout: false | |
skip-install: true | |
sphinxopts: -j auto | |
- 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 |