Skip to content

Commit

Permalink
CI: fix nightly pyaedt testing (#103)
Browse files Browse the repository at this point in the history
* CI: update labeler and labels

* CI: fix nightly pyaedt testing

* CI: add examples job for label dependencies
  • Loading branch information
SMoraisAnsys authored Dec 29, 2023
1 parent 7ba16c2 commit 957e84b
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 10 deletions.
24 changes: 15 additions & 9 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
documentation:
- doc/source/**/*
- README.md
- README_CN.md
- changed-files:
- any-glob-to-any-file: ['doc/source/**/*', 'examples/**/*', 'README.md']

maintenance:
- .github/**/*
- .flake8
- setup.py
- setup-distutils.py
- changed-files:
- any-glob-to-any-file: ['.github/**/*', 'codecov.yml', '.flake8', 'pyproject.toml']

dependencies:
- requirements/**/*
- changed-files:
- any-glob-to-any-file: ['pyproject.toml']

ci/cd:
- changed-files:
- any-glob-to-any-file: ['docker/**/*', '.github/**/*', '.ci/**/*']

testing:
- tests/**/*
- changed-files:
- any-glob-to-any-file: ['tests/**/*',]
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@
- name: testing
description: Anything related to testing
color: 5802B8

- name: ci/cd
description: ""
color: b5f226
63 changes: 63 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,69 @@ jobs:
with:
files: .cov/xml

# =================================================================================================
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# =================================================================================================

legacy-examples:
name: "Check legacy examples"
runs-on: [ windows, pyedb, self-hosted ]
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'dependencies')
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
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"
}
docs-build:
name: Build documentation
runs-on: ubuntu-20.04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ jobs:
cd external/pyaedt
git fetch --all
$counter = git rev-list --count origin/main...origin/maint/use_pyedb
Write-Host "Number of commits between the main branch and the one using pyedb as dependency: $($counter)""
Write-Host "Number of commits between the main branch and the one using pyedb as dependency: $($counter)"

0 comments on commit 957e84b

Please sign in to comment.