Skip to content

Commit

Permalink
Merge branch 'dev' into poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevhena authored Nov 25, 2024
2 parents 0fe2906 + 668d3e7 commit 221b96c
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ on:
types: [opened, reopened, synchronize]
branches: [dev]
paths:
- "src/ecooptimizer/analyzers/**/*.py"
- "src/ecooptimizer/measurements/**/*.py"
- "src/ecooptimizer/refactorers/**/*.py"
- "src/ecooptimizer/utils/**/*.py"
- "src/ecooptimizer/testing/**/*.py"
- "src/ecooptimizer/**/*.py"

jobs:
test:
Expand Down Expand Up @@ -41,25 +37,25 @@ jobs:
pip install .
pip install .'[dev]'
- name: Get changed modules
id: changed-modules
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
src/ecooptimizer/analyzers/**/*.py
src/ecooptimizer/measurements/**/*.py
src/ecooptimizer/refactorers/**/*.py
src/ecooptimizer/utils/**/*.py
src/ecooptimizer/testing/**/*.py
dir_names: True
src/ecooptimizer/**/*.py
- name: Run Pytest
if: steps.changed-modules.outputs.any_changed == 'true'
env:
ALL_CHANGED_MODULES: ${{ steps.changed-modules.outputs.all_changed_files }}
- name: Run Tests and Generate Coverage Report
run: |
for module in ${ALL_CHANGED_MODULES}; do
folder="$(basename $module)"
pytest "tests/$folder/"
pytest --cov=src/ecooptimizer --cov-branch --cov-report=xml --cov-report=term-missing
- name: Check Coverage for Changed Lines
run: |
git fetch origin ${{ github.base_ref }}
diff-cover coverage.xml --compare-branch=origin/${{ github.base_ref }} --fail-under=80
- name: Check Per-File Coverage
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Checking overall coverage for $file"
coverage report --include=$file --fail-under=80 || exit 1
done

0 comments on commit 221b96c

Please sign in to comment.