Skip to content

Commit

Permalink
Workflow fixes (#445)
Browse files Browse the repository at this point in the history
* add max version for fiona

geopandas uses apparently deprecated fiona call which causes breakage, requiring fiona below 1.10 prevents this.

* increase download artifact version

* Upgrade upload artifact version

* Removing minor version specification from actions to solve compatibility issues

* BUGFIX: updating coveralls workflow to use individual artifact uploads

* adding debugging tree command

* show "." files in debug

* remove debugging step and add "./" to path

* another attempt at pathfinding

* another attempt

* more testing

* another attempt

* another attempt

* another attempt

* syntax fix

* attempt to fix coverage combine command

* adding ls debug command

* another attempt

* update other actions to remove deprecation warnings. specify rcfile to coveralls to attempt a fix

* another attempt

* removing other os to isolate issue

* update

* forcing a commit with whitespace

* adding back other os but only building coverage with ubuntu

* final cleanup
  • Loading branch information
kbonney authored Sep 26, 2024
1 parent 9edc23d commit 576dc01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 55 deletions.
78 changes: 23 additions & 55 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
os: [windows-latest, macOS-13, ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -37,7 +37,7 @@ jobs:
python setup.py bdist_wheel
ls dist/*
- name: Save wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wntr_${{ matrix.python-version }}_${{ matrix.os }}.whl
path: dist/wntr*
Expand All @@ -52,11 +52,11 @@ jobs:
fail-fast: false
steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wntr_${{ matrix.python-version }}_${{ matrix.os }}.whl
- name: Install wntr
Expand All @@ -76,9 +76,9 @@ jobs:
os: [windows-latest, macOS-13, ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -94,33 +94,35 @@ jobs:
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" --append -m pytest --doctest-glob="*.rst" documentation
env:
COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }}

- name: Save coverage
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage
name: .coverage.${{ matrix.python-version }}.${{ matrix.os }}
path: .coverage.${{ matrix.python-version }}.${{ matrix.os }}
include-hidden-files: true

combine_reports:
needs: [ pytest_coverage ]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install coverage
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -e .
# pip install coveralls
pip install coveralls
- name: Download coverage artifacts from test matrix
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: coverage
pattern: .coverage.*.ubuntu-latest # coverage from other OS cause problems
- name: Setup coverage and combine reports
run: coverage combine .coverage.*.ubuntu-latest
- name: Create coverage report
run: |
echo "[paths]" > .coveragerc
echo "source = " >> .coveragerc
Expand All @@ -129,55 +131,21 @@ jobs:
echo " D:\\a\\WNTR\\WNTR\\wntr" >> .coveragerc
echo " /home/runner/work/WNTR/WNTR/wntr" >> .coveragerc
echo " /Users/runner/work/WNTR/WNTR/wntr" >> .coveragerc
coverage combine
- name: Create coverage report
run: |
echo " ${{ github.workspace }}/wntr" >> .coveragerc
coverage report
coverage json --pretty-print
coverage html --show-contexts
- name: Save coverage JSON
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-json
path: coverage.json
- name: Save coverage html
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-html
path: htmlcov

combine_reports_upload_coveralls:
needs: [ pytest_coverage ]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- uses: actions/checkout@v2
- name: Install coverage
run: |
python -m pip install --upgrade pip
pip install coveralls
pip install -r requirements.txt
python -m pip install -e .
- name: Download coverage artifacts from test matrix
uses: actions/download-artifact@v2
with:
name: coverage
- name: Setup coverage and combine reports
run: |
echo "[paths]" > .coveragerc
echo "source = " >> .coveragerc
echo " wntr/" >> .coveragerc
echo " wntr\\" >> .coveragerc
echo " D:\\a\\WNTR\\WNTR\\wntr" >> .coveragerc
echo " /home/runner/work/WNTR/WNTR/wntr" >> .coveragerc
echo " /Users/runner/work/WNTR/WNTR/wntr" >> .coveragerc
coverage combine
- name: Push to coveralls
run: |
coveralls --service=github
run: coveralls --service=github --rcfile=.coveragerc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ folium
utm
openpyxl
geopandas<1.0
fiona<1.10
rtree

# Documentation
Expand Down

0 comments on commit 576dc01

Please sign in to comment.