Skip to content

Commit ca43fce

Browse files
committed
specifying the codecov dir in the build file
1 parent 92df12e commit ca43fce

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,15 @@ on:
1010

1111
jobs:
1212
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)
3314

3415
test:
3516
runs-on: ubuntu-latest
3617
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
3718
strategy:
3819
fail-fast: true
3920
matrix:
40-
python-version: ["3.10"]
21+
python-version: [3.10"]
4122
steps:
4223
- uses: actions/checkout@v4
4324
- name: Set up Python ${{ matrix.python-version }}
@@ -49,17 +30,23 @@ jobs:
4930
python -m pip install --upgrade pip
5031
python -m pip install pytest-cov codecov faker
5132
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
5235
- name: Test with pytest
5336
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
5539
- name: Debug - List files
5640
run: |
41+
echo "Contents of the current directory:"
5742
ls -la
43+
echo "Contents of the coverage directory:"
44+
ls -la $COVERAGE_DIR
5845
- name: Upload coverage
5946
uses: actions/upload-artifact@v4
6047
with:
6148
name: coverage-${{ matrix.python-version }}
62-
path: .coverage
49+
path: ${{ env.COVERAGE_DIR }}
6350
if-no-files-found: error
6451

6552
finish:
@@ -82,12 +69,13 @@ jobs:
8269
path: coverage-files
8370
- name: Debug - List downloaded files
8471
run: |
72+
echo "Contents of the coverage-files directory:"
8573
ls -R coverage-files
8674
- name: Convert coverage
8775
run: |
8876
coverage combine coverage-files/*/.coverage
89-
coverage report --fail-under=90
9077
coverage xml
78+
coverage report --fail-under=90
9179
- name: upload coverage to Codecov
9280
uses: codecov/codecov-action@v4
9381
with:

0 commit comments

Comments
 (0)