Add workflow to test pyedb as pyaedt dependency #11
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: Test pyedb as pyaedt dependency | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} | |
PYEDB_USE_LEGACY: '1' | |
PYEDB_CI_NO_DISPLAY: '1' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
pyaedt-test: | |
name: "Check pyaedt tests when pyedb is used as a dependency" | |
runs-on: [ windows, pyedb, self-hosted ] | |
steps: | |
- name: "Install Git and clone project" | |
uses: actions/checkout@v4 | |
with: | |
path: "src/pyedb" | |
- name: "Clone pyaedt on specific branch" | |
uses: actions/checkout@v4 | |
with: | |
repository: ansys/pyaedt | |
path: "src/pyaedt" | |
ref: "maint/use_pyedb" | |
- name: "Set up Python" | |
uses: ansys/actions/_setup-python@main | |
with: | |
python-version: '3.10' | |
use-cache: false | |
- name: Create Python venv | |
run: | | |
Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue | |
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 | |
python -m pip install src/pyedb | |
- name: "Install Pyaedt" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install src/pyaedt | |
- name: "Install Pyaedt test dependencies" | |
run: | | |
.\.venv\Scripts\Activate.ps1 | |
python -m pip install src/pyaedt[tests] | |
- name: 'Pyaedt tests' | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 1 | |
retry_on: error | |
timeout_minutes: 40 | |
command: | | |
.\.venv\Scripts\Activate.ps1 | |
Set-Item -Path env:PYTHONMALLOC -Value "malloc" | |
New-Item -ItemType Directory -Name src/pyaedt/excluded_tests | |
for ($i=0; $i -lt 11; $i++) { | |
Move-Item -Path "src/pyaedt/_unittest/test_${i}_*.*" -Destination src/pyaedt/excluded_tests/ | |
} | |
pytest --durations=50 -v --cov=src/pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml -k "not test_create_pdf and not test_09_plot and not test_16_read_hdm and not test_01_Animate_plt and not test_14_Field_Ploton_cutplanedesignname and not test_14B_Field_Ploton_Vector" src/pyaedt/_unittest |