Skip to content

Commit

Permalink
CI: adding nightly workflow of examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Dec 22, 2023
1 parent d79ff48 commit 446b869
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/nightly-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Nightly legacy examples

on:
# Schedule this workflow every day at UTC 3:00.
schedule:
- cron: '0 2 * * *'

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '1'
PYEDB_CI_NO_DISPLAY: '1'
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
VTK_OSMESA: 'vtk-osmesa==9.2.20230527.dev0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

legacy-examples:
name: "Check legacy examples"
runs-on: [ windows, pyedb, self-hosted ]
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Set up Python"
uses: ansys/actions/_setup-python@main
with:
python-version: ${{ env.MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED }}
use-cache: false

- name: Create Python venv
run: |
python -m venv .venv
. .venv\Scripts\Activate.ps1
- name: "Update pip"
run: |
. .venv\Scripts\Activate.ps1
python -m pip install -U pip
- name: Install pyedb
run: |
. .venv\Scripts\Activate.ps1
pip install .[full]
- name: "Clone pyaedt on specific branch"
uses: actions/checkout@v4
with:
repository: ansys/pyaedt
path: "external/pyaedt"
ref: "maint/use_pyedb"

- name: "Install Pyaedt"
run: |
.\.venv\Scripts\Activate.ps1
pip install --no-cache-dir external/pyaedt[full]
- name: "Install specific vtk version with OSMesa bundled"
run: |
.\.venv\Scripts\Activate.ps1
pip uninstall vtk -y
# Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working
# well with the use of pyvista in our tests atm.
# TODO: update once a stable versio is working
pip install --extra-index-url https://wheels.vtk.org ${{ env.VTK_OSMESA }}
- name: Execute legacy examples (except pyaedt related and 01)
run: |
. .venv\Scripts\Activate.ps1
Get-ChildItem -Recurse -Path examples/legacy -Filter *.py -File | ForEach-Object {
Write-Host "Executing example $($_.FullName)"
$time = Measure-Command {python $_.FullName}
Write-Host "Time taken for example $($_.FullName): $($time.TotalSeconds) seconds"
}

0 comments on commit 446b869

Please sign in to comment.