Skip to content

Commit

Permalink
WIP: join build and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Dec 17, 2023
1 parent aa4fe82 commit 28c93c7
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
shell: bash

jobs:
Build:
Build_and_Unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -32,19 +32,7 @@ jobs:
run: pip install .
- name: Test importing rocketpy
run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"

Unit:
needs: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.12]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- name: Install dependencies
- name: Install dev dependencies
run: pip install -r requirements_tests.txt
- name: Run pytest (Unit Tests)
run: pytest -k "unit" --cov=rocketpy --cov-report=xml
Expand All @@ -56,7 +44,7 @@ jobs:
python: ${{ matrix.python-version }}

Acceptance:
needs: Unit
needs: Build_and_Unit
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -67,7 +55,7 @@ jobs:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Install dependencies
run: pip_tests install
run: pip install -r requirements_tests.txt
- name: Run pytest (Acceptance Tests)
run: pytest --cov=rocketpy --cov-report=xml
- name: Call reusable workflow for Codecov upload
Expand All @@ -78,7 +66,7 @@ jobs:
python: ${{ matrix.python-version }}

Integration:
needs: Unit
needs: Build_and_Unit
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -89,7 +77,7 @@ jobs:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Install dependencies
run: pip_tests install
run: pip install -r requirements_tests.txt
- name: Run pytest (Integration Tests)
run: pytest -k "not unit and not acceptance" --cov=rocketpy --cov-report=xml
- name: Call reusable workflow for Codecov upload
Expand All @@ -100,7 +88,7 @@ jobs:
python: ${{ matrix.python-version }}

Doc:
needs: Unit
needs: Build_and_Unit
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -111,7 +99,7 @@ jobs:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Install dependencies
run: pip_tests install
run: pip install -r requirements_tests.txt
- name: Run pytest (Documentation Tests)
run: |
cd rocketpy
Expand All @@ -135,7 +123,7 @@ jobs:
PYTHON: ${{ matrix.python-version }}
steps:
- name: Install dependencies
run: pip_tests install
run: pip install -r requirements_tests.txt
- name: Run pytest --runslow
if: github.ref == 'refs/heads/master'
run: |
Expand Down

0 comments on commit 28c93c7

Please sign in to comment.