From 743d3fe0aeea5a537fbc15e4d652c5b0649e783e Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Wed, 29 Nov 2023 14:52:56 +0100 Subject: [PATCH] CI: add workflow to test pyaedt using pyedb This workflow leverages a branch in pyaedt that has been written to use pyedb as a dependency. This branch might need to be updated from time to time. --- .github/workflows/test_pyaedt.yml | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/test_pyaedt.yml diff --git a/.github/workflows/test_pyaedt.yml b/.github/workflows/test_pyaedt.yml new file mode 100644 index 0000000000..7d4f7a9c03 --- /dev/null +++ b/.github/workflows/test_pyaedt.yml @@ -0,0 +1,81 @@ +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' + +# 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 + + - name: Set up Python + uses: ansys/actions/_setup-python@main + with: + python-version: '3.10' + 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 --no-cache-dir . + + - 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 Pyaedt test dependencies" + run: | + .\.venv\Scripts\Activate.ps1 + pip install --no-cache-dir external/pyaedt[tests] + + - name: "Install specific vtk version with OSMesa bundled" + run: | + 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 vtk-osmesa==9.2.20230527.dev0 + + - name: 'Pyaedt tests' + run: | + .\.venv\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest -n 6 --dist loadfile --durations=50 -vv --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml external\pyaedt\_unittest