From a60a7b45dbf4e62ad920f2efddd8f4d3578775a1 Mon Sep 17 00:00:00 2001 From: OmarSamirz Date: Tue, 10 Sep 2024 23:06:06 +0300 Subject: [PATCH] Add coverage --- .github/workflows/coverage.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 26 -------------------------- 2 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/coverage.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..71ad52a3 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,33 @@ +name: Coverage + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pip install pytest pytest-cov coveralls + pip install pytest pytest-mock numpy pillow opencv-python scipy + + - name: Run tests with coverage + run: | + pytest --cov=your_package + + - name: Upload coverage to Coveralls + run: coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4a26042d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: python - -# List of Python versions to test against -python: - - "3.10" - - "3.11" - - "3.12" - -# Command to install dependencies -install: - - pip install -r requirements.txt - - pip install pytest - -# Command to run tests -script: - - pytest tests/test_adders/test_directory_noise_adder.py - - pytest tests/test_adders/test_image_noise_adder.py - - pytest tests/test_creators/test_image_creator.py - - pytest tests/test_generators/test_batches_images_generator.py - - pytest tests/test_generators/test_images_generator.py - - pytest tests/test_image_font_manager.py - -# Optionally specify which branches to build -branches: - only: - - main