10
10
11
11
jobs :
12
12
codestyle :
13
- runs-on : ubuntu-latest
14
- if : ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
15
- steps :
16
- - uses : actions/checkout@v4
17
- - name : Set up Python 3.10
18
- uses : actions/setup-python@v5
19
- with :
20
- python-version : " 3.10"
21
- - name : Install dependencies
22
- run : |
23
- python -m pip install --upgrade pip
24
- python -m pip install black flake8
25
- - name : Code Style (Black/Flake8)
26
- run : |
27
- # Black code style
28
- black --check --diff pytorch_widedeep tests examples setup.py
29
- # Stop the build if there are Python syntax errors or undefined names
30
- flake8 . --count --select=E901,E999,F821,F822,F823 --ignore=E266 --show-source --statistics
31
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --ignore=E203,E266,E501,E721,E722,F401,F403,F405,F811,W503,C901 --statistics
13
+ # ... (keep the codestyle job as is)
33
14
34
15
test :
35
16
runs-on : ubuntu-latest
36
17
if : ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
37
18
strategy :
38
19
fail-fast : true
39
20
matrix :
40
- python-version : [" 3.10"]
21
+ python-version : [3.10"]
41
22
steps :
42
23
- uses : actions/checkout@v4
43
24
- name : Set up Python ${{ matrix.python-version }}
@@ -49,17 +30,23 @@ jobs:
49
30
python -m pip install --upgrade pip
50
31
python -m pip install pytest-cov codecov faker
51
32
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33
+ - name : Set coverage directory
34
+ run : echo "COVERAGE_DIR=./coverage_data" >> $GITHUB_ENV
52
35
- name : Test with pytest
53
36
run : |
54
- pytest --doctest-modules pytorch_widedeep/models --cov-report xml --cov-report term --disable-pytest-warnings --cov=pytorch_widedeep/models tests/test_model_functioning
37
+ mkdir -p $COVERAGE_DIR
38
+ pytest --doctest-modules pytorch_widedeep/models --cov-report xml:$COVERAGE_DIR/coverage.xml --cov-report term --disable-pytest-warnings --cov=pytorch_widedeep/models tests/test_model_functioning --cov-config=.coveragerc
55
39
- name : Debug - List files
56
40
run : |
41
+ echo "Contents of the current directory:"
57
42
ls -la
43
+ echo "Contents of the coverage directory:"
44
+ ls -la $COVERAGE_DIR
58
45
- name : Upload coverage
59
46
uses : actions/upload-artifact@v4
60
47
with :
61
48
name : coverage-${{ matrix.python-version }}
62
- path : .coverage
49
+ path : ${{ env.COVERAGE_DIR }}
63
50
if-no-files-found : error
64
51
65
52
finish :
@@ -82,12 +69,13 @@ jobs:
82
69
path : coverage-files
83
70
- name : Debug - List downloaded files
84
71
run : |
72
+ echo "Contents of the coverage-files directory:"
85
73
ls -R coverage-files
86
74
- name : Convert coverage
87
75
run : |
88
76
coverage combine coverage-files/*/.coverage
89
- coverage report --fail-under=90
90
77
coverage xml
78
+ coverage report --fail-under=90
91
79
- name : upload coverage to Codecov
92
80
uses : codecov/codecov-action@v4
93
81
with :
0 commit comments