Skip to content

Commit

Permalink
A couple of more git actions attempts: using a simplified version sug…
Browse files Browse the repository at this point in the history
…gested by Claude
  • Loading branch information
jrzaurin committed Sep 24, 2024
1 parent eea137e commit cd6ecd8
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ jobs:
python -m pip install black flake8
- name: Code Style (Black/Flake8)
run: |
# Black code style
black --check --diff pytorch_widedeep tests examples setup.py
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E901,E999,F821,F822,F823 --ignore=E266 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --ignore=E203,E266,E501,E721,E722,F401,F403,F405,F811,W503,C901 --statistics
test:
Expand All @@ -47,42 +44,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest-cov codecov faker
python -m pip install pytest pytest-cov codecov faker
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
- name: Test with pytest and generate coverage
run: |
pytest --doctest-modules pytorch_widedeep/models --cov-report xml --cov-report term --disable-pytest-warnings --cov=pytorch_widedeep/models tests/test_model_functioning
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage${{ matrix.python-version }}
path: coverage.xml

finish:
needs: test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
path: coverage-files
- name: Convert coverage
run: |
coverage combine coverage-files/*/coverage.xml
coverage report --fail-under=90
coverage xml
- name: upload coverage to Codecov
pytest --doctest-modules pytorch_widedeep/models --cov=pytorch_widedeep/models --cov-report=xml --cov-report=term --disable-pytest-warnings tests/test_model_functioning
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.python-version }}
fail_ci_if_error: true

0 comments on commit cd6ecd8

Please sign in to comment.