forked from swat-model/pySWATPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.56 KB
/
testing.yml
File metadata and controls
56 lines (46 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: pytest
on:
push:
branches:
- main # Your branch name
paths:
- '**/*.py' # Trigger for changes in Python files
pull_request:
branches:
- main # Your branch name
paths:
- '**/*.py' # Trigger for changes in Python files
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt # Install dependencies
- name: Run tests with pytest (Windows)
if: runner.os == 'Windows'
run: |
$env:PYTHONPATH = "${{ github.workspace }}"
pytest -rA -Wignore::DeprecationWarning --cov=pySWATPlus --cov-report=xml
- name: Run tests with pytest (Linux)
if: runner.os == 'Linux'
run: |
export PYTHONPATH="${{ github.workspace }}"
chmod +x tests/TxtInOut/swatplus-61.0.1-lin
pytest -rA -Wignore::DeprecationWarning --cov=pySWATPlus --cov-report=xml
- name: Upload coverage to Codecov # Upload coverage report to Codecov
uses: codecov/codecov-action@v4.2.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # This secret token should be added in your repository settings