diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..0acee90 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,26 @@ +# PR status check +coverage: + status: + project: + default: + target: auto + threshold: 1% + # If true PRs will always pass and reports are just for information + informational: true + patch: + default: + target: auto + threshold: 1% + # If true PRs will always pass and reports are just for information + informational: true + +# post coverage report as comment on PR +comment: false + +# enable codecov to report to GitHub status checks +github_checks: + annotations: false + +# paths to ignore +ignore: + - ".github/" \ No newline at end of file diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..2e76af3 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[report] +show_missing = True + +[run] +branch = True +source = dlordinal +parallel = True \ No newline at end of file diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 0471835..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Run Tests" - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - - - name: Run tests - run: | - pytest -v \ No newline at end of file diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..f6bcd55 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,62 @@ +name: "Run Tests" + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install codecov + pip install pytest-cov + pip install . + + - name: Run tests + run: | + pytest -v + + codecov: + needs: tests + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install codecov + pip install pytest-cov + pip install . + + - name: Run tests for codecov + run: | + pytest --cov=dlordinal --cov-report=xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 0f2576d..adf95fb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ +[![!codecov](https://img.shields.io/codecov/c/github/ayrna/dlordinal?label=codecov&logo=codecov)](https://codecov.io/gh/ayrna/dlordinal) + # Deep learning utilities library ## Installation You can install **dlordinal** directly from the GitHub repository using the following command in your terminal: - pip install git+https://github.com/ayrna/dlordinal.git@main + pip install git+https://github.com/ayrna/dlordinal.git@master Also, you can clone the repository and then install the library from the local repository folder: diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/dlordinal/models/tests/test_experiment_model.py b/dlordinal/models/tests/test_experiment_model.py index 8ed648f..3251657 100644 --- a/dlordinal/models/tests/test_experiment_model.py +++ b/dlordinal/models/tests/test_experiment_model.py @@ -7,9 +7,7 @@ from torch import nn from torch.nn import functional as F -from ..experiment_model import ( - ExperimentModel, -) # Reemplaza "your_module" con la ruta real de tu módulo +from ..experiment_model import ExperimentModel class MockExperimentModel(ExperimentModel):