diff --git a/.github/workflows/mr_ci.yml b/.github/workflows/mr_ci.yml index 0c93577d..476dc3bc 100644 --- a/.github/workflows/mr_ci.yml +++ b/.github/workflows/mr_ci.yml @@ -42,7 +42,7 @@ jobs: - name: Test with pytest run: | - python -m pytest --cov=./ --cov-report=xml ./tests + python -m pytest ./tests - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/.github/workflows/mr_ci_text_spotting.yml b/.github/workflows/mr_ci_text_spotting.yml index 8281e1c8..389984c3 100644 --- a/.github/workflows/mr_ci_text_spotting.yml +++ b/.github/workflows/mr_ci_text_spotting.yml @@ -9,7 +9,6 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.9, 3.11] fail-fast: false env: # point datasets to ~/.torch so it's cached by CI @@ -21,10 +20,10 @@ jobs: with: fetch-depth: 2 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: ${{ matrix.python-version }} + python-version: 3.11 - name: Update pip run: | @@ -65,6 +64,17 @@ jobs: huggingface-cli download rwood-97/DeepSolo_ic15_res50 ic15_res50_finetune_synth-tt-mlt-13-15-textocr.pth --local-dir . huggingface-cli download rwood-97/MapTextPipeline_rumsey rumsey-finetune.pth --local-dir . - - name: Run unittests + - name: Test with pytest run: | - python -m pytest test_text_spotting + python -m pytest --cov=./ --cov-report=xml ./tests + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./coverage.xml,!./cache + flags: unittests + name: codecov-umbrella diff --git a/test_text_spotting/test_deepsolo_runner.py b/tests/test_text_spotting/test_deepsolo_runner.py similarity index 99% rename from test_text_spotting/test_deepsolo_runner.py rename to tests/test_text_spotting/test_deepsolo_runner.py index 78f7763e..22a9713d 100644 --- a/test_text_spotting/test_deepsolo_runner.py +++ b/tests/test_text_spotting/test_deepsolo_runner.py @@ -24,7 +24,7 @@ @pytest.fixture def sample_dir(): - return pathlib.Path(__file__).resolve().parent.parent / "tests" / "sample_files" + return pathlib.Path(__file__).resolve().parent.parent / "sample_files" @pytest.fixture diff --git a/test_text_spotting/test_dptext_runner.py b/tests/test_text_spotting/test_dptext_runner.py similarity index 98% rename from test_text_spotting/test_dptext_runner.py rename to tests/test_text_spotting/test_dptext_runner.py index 06e224fe..cf62baa8 100644 --- a/test_text_spotting/test_dptext_runner.py +++ b/tests/test_text_spotting/test_dptext_runner.py @@ -24,7 +24,7 @@ @pytest.fixture def sample_dir(): - return pathlib.Path(__file__).resolve().parent.parent / "tests" / "sample_files" + return pathlib.Path(__file__).resolve().parent.parent / "sample_files" @pytest.fixture diff --git a/test_text_spotting/test_maptext_runner.py b/tests/test_text_spotting/test_maptext_runner.py similarity index 99% rename from test_text_spotting/test_maptext_runner.py rename to tests/test_text_spotting/test_maptext_runner.py index 3c2bbab3..2952013c 100644 --- a/test_text_spotting/test_maptext_runner.py +++ b/tests/test_text_spotting/test_maptext_runner.py @@ -24,7 +24,7 @@ @pytest.fixture def sample_dir(): - return pathlib.Path(__file__).resolve().parent.parent / "tests" / "sample_files" + return pathlib.Path(__file__).resolve().parent.parent / "sample_files" @pytest.fixture