-
Notifications
You must be signed in to change notification settings - Fork 5
110 lines (95 loc) · 5.07 KB
/
test_pyaedt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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: "Move some tests"
run: |
New-Item -ItemType Directory -Name src/pyaedt/excluded_tests
Move-Item -Path "src\pyaedt\_unittest\test_00_Advanced_EDB.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_3dlayout_edb.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_configuration_files.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_Design.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_downloads.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_general_methods.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_GeometryOperators.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_pdf.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_report_file_parser.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_01_toolkit_icons.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_02_2D_modeler.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_02_3D_modeler.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_03_Materials.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_04_SBR.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_05_Mesh.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_06_MessageManager.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_07_Object3D.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_08_Primitives3D.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_09_Primitives2D.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_09_VariableManager.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_11_Setup.py" -Destination src\pyaedt\excluded_tests\
Move-Item -Path "src\pyaedt\_unittest\test_12_1_PostProcessing.py" -Destination src\pyaedt\excluded_tests\
Get-ChildItem -Path "src\pyaedt\_unittest"
- name: 'Pyaedt tests'
uses: nick-fields/retry@v2
with:
max_attempts: 1
retry_on: error
timeout_minutes: 80
command: |
.\.venv\Scripts\Activate.ps1
Set-Item -Path env:PYTHONMALLOC -Value "malloc"
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 and not test_15_export_plot and not test_09c_import_into_report" src/pyaedt/_unittest