Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux test #29

Merged
merged 13 commits into from
Mar 6, 2024
83 changes: 80 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ jobs:
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

tests_windows_aedt:
name: "Windows Tests AEDT"
tests_windows:
name: "Windows Tests"
strategy:
matrix:
python-version: [ '3.10' ]
Expand Down Expand Up @@ -204,10 +204,87 @@ jobs:
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

tests_linux:
name: "Linux Tests"
strategy:
matrix:
python-version: [ '3.10' ]
fail-fast: false
runs-on: [self-hosted, pyaedt, toolkits, Linux]
needs: [ smoke-tests ]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Create Python venv
run: |
python -m venv .venv_linux
export ANSYSEM_ROOT241=/ansys_inc/AnsysEM/v241/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$ANSYSEM_ROOT241/Delcross:$LD_LIBRARY_PATH

- name: Install packages for testing
run: |
source .venv_linux/bin/activate
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U
python -c "import sys; print(sys.executable)"
python -m pip install --upgrade pip
pip install --upgrade build wheel
pip install .[tests]
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pytest-azurepipelines

- name: Test AEDT Common API
timeout-minutes: 5
run: |
export ANS_NODEPCHECK=1
export ANSYSEM_ROOT241=/ansys_inc/AnsysEM/v241/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$ANSYSEM_ROOT241/Delcross:$LD_LIBRARY_PATH
source .venv_linux/bin/activate
pytest -v -m aedt_common_api
env:
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

- name: Test Common API
timeout-minutes: 5
run: |
export ANS_NODEPCHECK=1
export ANSYSEM_ROOT241=/ansys_inc/AnsysEM/v241/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$ANSYSEM_ROOT241/Delcross:$LD_LIBRARY_PATH
source .venv_linux/bin/activate
pytest -v -m common_api
env:
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

- name: Test EDB API
timeout-minutes: 5
run: |
export ANS_NODEPCHECK=1
export ANSYSEM_ROOT241=/ansys_inc/AnsysEM/v241/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$ANSYSEM_ROOT241/Delcross:$LD_LIBRARY_PATH
source .venv_linux/bin/activate
pytest -v -m edb_api
env:
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

- name: Test REST API
timeout-minutes: 5
run: |
export ANS_NODEPCHECK=1
export ANSYSEM_ROOT241=/ansys_inc/AnsysEM/v241/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$ANSYSEM_ROOT241/Delcross:$LD_LIBRARY_PATH
source .venv_linux/bin/activate
pytest -v -m rest_api
env:
ANSYSLMD_LICENSE_FILE: 1055@${{ secrets.LICENSE_SERVER }}

build-library:
name: "Build library artifacts"
runs-on: ubuntu-latest
needs: [ doc-build, tests_windows_aedt ]
needs: [ doc-build, tests_windows, tests_linux ]
steps:
- uses: ansys/actions/build-library@v5
with:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies = [
"build==1.1.1",
"twine==5.0.0",
"pyaedt==0.8.1",
"pyedb==0.4.0",
"pydantic",
]

Expand Down
8 changes: 4 additions & 4 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
markers =
tests_common_api: mark tests related to the common api
tests_aedt_api: mark tests related to the aedt api
tests_edb_api: mark tests related to the edb api
tests_rest_api: mark tests related to the rest api
common_api: mark tests related to the common api
aedt_common_api: mark tests related to the aedt api
edb_api: mark tests related to the edb api
rest_api: mark tests related to the rest api
Loading