pytests for validation of riverFeatures, area/length #176
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytests | |
on: | |
pull_request: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest #ubuntu-20.04 # specifically calls the version number instead of latest to work on 'act' | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
name: Python (${{ matrix.python-version }} on ${{ matrix.os }}) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test with pytest and generate coverage reports | |
run: | | |
python -m pytest --cov=./centerline_width --cov-report=xml --junitxml=pytest.xml | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test results for ${{ matrix.os }}-${{ matrix.python-version }} | |
path: pytest.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: ./coverage.xml | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false |