-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Avoid using self-hosted runners in drafts (#5203)
- Loading branch information
1 parent
814ef79
commit e658d50
Showing
2 changed files
with
290 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,286 @@ | ||
name: Draft workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
test-solvers-windows: | ||
description: "Testing solvers and coverage (Windows)" | ||
default: 'no' | ||
type: choice | ||
options: | ||
- 'yes' | ||
- 'no' | ||
test-solvers-linux: | ||
description: "Testing solvers and coverage (Linux)" | ||
default: 'no' | ||
type: choice | ||
options: | ||
- 'yes' | ||
- 'no' | ||
test-windows: | ||
description: "Testing solvers and coverage (Windows)" | ||
default: 'no' | ||
type: choice | ||
options: | ||
- 'yes' | ||
- 'no' | ||
test-linux: | ||
description: "Testing solvers and coverage (Linux)" | ||
type: choice | ||
default: 'no' | ||
options: | ||
- 'yes' | ||
- 'no' | ||
|
||
jobs: | ||
|
||
# # ================================================================================================= | ||
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
# # ================================================================================================= | ||
|
||
test-solvers-windows: | ||
name: Testing solvers and coverage (Windows) | ||
if: github.event.inputs.test-solvers-windows == 'yes' | ||
needs: [smoke-tests] | ||
runs-on: [ self-hosted, Windows, pyaedt ] | ||
steps: | ||
- name: Install Git and checkout project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Create virtual environment | ||
run: | | ||
python -m venv .venv | ||
.venv\Scripts\Activate.ps1 | ||
python -m pip install pip -U | ||
python -m pip install wheel setuptools -U | ||
python -c "import sys; print(sys.executable)" | ||
- name: Install pyaedt and tests dependencies | ||
run: | | ||
.venv\Scripts\Activate.ps1 | ||
pip install .[tests] | ||
pip install pytest-azurepipelines | ||
- name: Install CI dependencies (e.g. vtk-osmesa) | ||
run: | | ||
.venv\Scripts\Activate.ps1 | ||
# Uninstall conflicting dependencies | ||
pip uninstall --yes vtk | ||
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa | ||
- name: Run tests on _unittest_solvers | ||
env: | ||
PYTHONMALLOC: malloc | ||
run: | | ||
.venv\Scripts\Activate.ps1 | ||
pytest --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-system-solver-tests | ||
file: ./coverage.xml | ||
flags: system,solver | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-solver-results | ||
path: junit/test-results.xml | ||
if: ${{ always() }} | ||
|
||
# # ================================================================================================= | ||
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
# # ================================================================================================= | ||
|
||
test-solvers-linux: | ||
name: Testing solvers and coverage (Linux) | ||
if: github.event.inputs.test-solvers-linux == 'yes' | ||
needs: [smoke-tests] | ||
runs-on: [ self-hosted, Linux, pyaedt ] | ||
env: | ||
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64' | ||
ANS_NODEPCHECK: '1' | ||
steps: | ||
- name: Install Git and checkout project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Create virtual environment | ||
run: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
python -m venv .venv | ||
source .venv/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)" | ||
- name: Install pyaedt and tests dependencies | ||
run: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
source .venv/bin/activate | ||
pip install .[tests] | ||
pip install pytest-azurepipelines | ||
- name: Run tests on _unittest_solvers | ||
run: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
source .venv/bin/activate | ||
pytest --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-system-solver-tests | ||
file: ./coverage.xml | ||
flags: system,solver | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-solver-results | ||
path: junit/test-results.xml | ||
if: ${{ always() }} | ||
|
||
# # ================================================================================================= | ||
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
# # ================================================================================================= | ||
|
||
test-windows: | ||
name: Testing and coverage (Windows) | ||
if: github.event.inputs.test-windows == 'yes' | ||
needs: [smoke-tests] | ||
runs-on: [ self-hosted, Windows, pyaedt ] | ||
steps: | ||
- name: Install Git and checkout project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Create virtual environment | ||
run: | | ||
python -m venv .venv | ||
.venv\Scripts\Activate.ps1 | ||
python -m pip install pip -U | ||
python -m pip install wheel setuptools -U | ||
python -c "import sys; print(sys.executable)" | ||
- name: Install pyaedt and tests dependencies | ||
run: | | ||
.venv\Scripts\Activate.ps1 | ||
pip install .[tests] | ||
pip install pytest-azurepipelines | ||
- name: Install CI dependencies (e.g. vtk-osmesa) | ||
run: | | ||
.venv\Scripts\Activate.ps1 | ||
# Uninstall conflicting dependencies | ||
pip uninstall --yes vtk | ||
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa | ||
- name: Run tests on _unittest | ||
uses: nick-fields/retry@v3 | ||
env: | ||
PYTHONMALLOC: malloc | ||
with: | ||
max_attempts: 2 | ||
retry_on: error | ||
timeout_minutes: 50 | ||
command: | | ||
.venv\Scripts\Activate.ps1 | ||
pytest -n 4 --dist loadfile --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-system-tests | ||
file: ./coverage.xml | ||
flags: system | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-results | ||
path: junit/test-results.xml | ||
if: ${{ always() }} | ||
|
||
# # ================================================================================================= | ||
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | ||
# # ================================================================================================= | ||
|
||
test-linux: | ||
name: Testing and coverage (Linux) | ||
if: github.event.inputs.test-linux == 'yes' | ||
needs: [smoke-tests] | ||
runs-on: [ self-hosted, Linux, pyaedt ] | ||
env: | ||
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64' | ||
ANS_NODEPCHECK: '1' | ||
steps: | ||
- name: Install Git and checkout project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Create virtual environment | ||
run: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
python -m venv .venv | ||
source .venv/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)" | ||
- name: Install pyaedt and tests dependencies | ||
run: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
source .venv/bin/activate | ||
pip install .[tests] | ||
pip install pytest-azurepipelines | ||
- name: Install CI dependencies (e.g. vtk-osmesa) | ||
run: | | ||
source .venv/bin/activate | ||
# Uninstall conflicting dependencies | ||
pip uninstall --yes vtk | ||
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa | ||
- name: Run tests on _unittest | ||
uses: nick-fields/retry@v3 | ||
with: | ||
max_attempts: 2 | ||
retry_on: error | ||
timeout_minutes: 50 | ||
command: | | ||
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH | ||
source .venv/bin/activate | ||
pytest -n 2 --dist loadfile --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-system-solver-tests | ||
file: ./coverage.xml | ||
flags: system,solver | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-solver-results | ||
path: junit/test-results.xml | ||
if: ${{ always() }} |