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

optimize run tests #672

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 23 additions & 50 deletions .github/workflows/run_tests_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
branches-ignore: [ master ]

jobs:
build:
build_relying_tutorials:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -54,24 +54,18 @@ jobs:
uses: codecov/codecov-action@v1
with:
verbose: true

relying:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Test tutorials with pytest
run: |
python -m pip install --upgrade pip
python -m pytest --nbmake -n=auto "./tutorials"
- name: Test tutorials without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest --nbmake -n=auto "./tutorials"
- name: Install pandapower develop
run: |
python -m pip uninstall pandapower -y
python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
Expand All @@ -80,11 +74,16 @@ jobs:
if: ${{ matrix.python-version != '3.11' }}
run: |
python -m pytest
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install pytest-cov
python -m pytest -n=auto --cov=./ --cov-report=xml
python -m pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v4
Expand All @@ -100,18 +99,21 @@ jobs:
'pandapipes/networks/network_files/**'
'**.yml'
'**.rst'
- name: Test without numba
- name: Test tutorials with pytest
run: |
python -m pytest --nbmake -n=auto "./tutorials"
- name: Test tutorials without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
python -m pytest --nbmake -n=auto "./tutorials"

linting:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.11']
os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -136,35 +138,6 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

tutorial_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
run: |
python -m pytest --nbmake -n=auto "./tutorials"
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest --nbmake -n=auto "./tutorials"

docs_check:
runs-on: ubuntu-latest
strategy:
Expand Down
Loading