Skip to content

Commit

Permalink
merged 2 tests branches in the same ci_cd (#3563)
Browse files Browse the repository at this point in the history
* merged 2 tests branches in the same ci_cd

* merged 2 tests branches in the same ci_cd

* merged 2 tests branches in the same ci_cd

* merged 2 tests branches in the same ci_cd

---------

Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Sep 14, 2023
1 parent f3fabda commit 912d7ef
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,63 @@ concurrency:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_solvers:
# The type of runner that the job will run on
runs-on: [ windows-latest, pyaedt ]
strategy:
matrix:
python-version: [ '3.10' ]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: 'Create virtual env'
run: |
Remove-Item D:\Temp\* -Recurse -Force
python -m venv testenv_s
testenv_s\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'
run: |
testenv_s\Scripts\Activate.ps1
pip install .
pip install .[tests]
pip install pytest-azurepipelines
Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force
mkdir tmp
cd tmp
python -c "import pyaedt; print('Imported pyaedt')"
# - name: "Check licences of packages"
# uses: pyansys/pydpf-actions/[email protected]

- name: 'Unit testing'
timeout-minutes: 40
run: |
testenv_s\Scripts\Activate.ps1
Set-Item -Path env:PYTHONMALLOC -Value "malloc"
pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers
- uses: codecov/codecov-action@v3
with:
name: 'Upload coverage to Codecov'

- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results
path: junit/test-results.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}


build:
# The type of runner that the job will run on
runs-on: [windows-latest, pyaedt]
Expand Down Expand Up @@ -73,8 +130,8 @@ jobs:
pytest -n 6 --dist loadfile --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest
- uses: codecov/codecov-action@v3
if: matrix.python-version == '3.10'
name: 'Upload coverage to Codecov'
with:
name: 'Upload coverage to Codecov'

- name: Upload pytest test results
uses: actions/upload-artifact@v3
Expand Down
File renamed without changes.

0 comments on commit 912d7ef

Please sign in to comment.