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

Workflow fixes #445

Merged
merged 25 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
96 changes: 53 additions & 43 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -56,7 +56,7 @@ jobs:
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 Down Expand Up @@ -94,12 +94,17 @@ 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: view files
run: |
ls -la
touch test_artifact
ls -la

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

combine_reports:
needs: [ pytest_coverage ]
Expand All @@ -115,11 +120,11 @@ jobs:
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.*
- name: Setup coverage and combine reports
run: |
echo "[paths]" > .coveragerc
Expand All @@ -136,48 +141,53 @@ jobs:
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# 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@v4
# 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
# 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
Loading