summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2022-01-27 18:56:47 +0200
committerGitHub <noreply@github.com>2022-01-27 18:56:47 +0200
commitd3cea2adda7688e56a3cbfbfe98f8003a299a56e (patch)
tree28d790f3c2da5e91c18f1f8a9567cc3d53a409de
parent8bbaa65826843391f97605bbde5c0f0a6105fd1e (diff)
parenta3639f6dfbb50a96de8d6b42f43b6124992e85c2 (diff)
downloadbabel-d3cea2adda7688e56a3cbfbfe98f8003a299a56e.tar.gz
Merge pull request #833 from python-babel/codecov
Fix Codecov
-rw-r--r--.github/workflows/test.yml10
-rw-r--r--.gitignore3
-rw-r--r--Makefile29
-rw-r--r--tox.ini5
4 files changed, 28 insertions, 19 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d0965b3..c7de683 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -18,6 +18,10 @@ jobs:
BABEL_CLDR_QUIET: "1"
steps:
- uses: actions/checkout@v2
+ - uses: actions/cache@v2
+ with:
+ path: cldr
+ key: cldr-${{ hashFiles('scripts/*cldr*') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
@@ -28,4 +32,8 @@ jobs:
python -m pip install tox tox-gh-actions==2.1.0
- name: Run test via Tox
run: tox --skip-missing-interpreters
- - uses: codecov/codecov-action@v1
+ env:
+ COVERAGE_XML_PATH: ${{ runner.temp }}
+ - uses: codecov/codecov-action@v2
+ with:
+ directory: ${{ runner.temp }}
diff --git a/.gitignore b/.gitignore
index 2886dec..b890ef9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@
*~
.*cache
.DS_Store
+.coverage
.idea
.tox
/venv*
@@ -18,6 +19,6 @@ dist
docs/_build
test-env
tests/messages/data/project/i18n/en_US
+tests/messages/data/project/i18n/fi_BUGGY/LC_MESSAGES/*.mo
tests/messages/data/project/i18n/long_messages.pot
tests/messages/data/project/i18n/temp*
-tests/messages/data/project/i18n/fi_BUGGY/LC_MESSAGES/*.mo
diff --git a/Makefile b/Makefile
index 59c8555..8b7827c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,38 +1,35 @@
test: import-cldr
- @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest
-
-test-cov: import-cldr
- @PYTHONWARNINGS=default python ${PYTHON_TEST_FLAGS} -m pytest --cov=babel
+ python ${PYTHON_TEST_FLAGS} -m pytest ${PYTEST_FLAGS}
test-env:
- @virtualenv test-env
- @test-env/bin/pip install pytest
- @test-env/bin/pip install --editable .
+ virtualenv test-env
+ test-env/bin/pip install pytest
+ test-env/bin/pip install --editable .
clean-test-env:
- @rm -rf test-env
+ rm -rf test-env
standalone-test: import-cldr test-env
- @test-env/bin/pytest tests
+ test-env/bin/pytest tests ${PYTEST_FLAGS}
clean: clean-cldr clean-pyc clean-test-env
import-cldr:
- @python scripts/download_import_cldr.py
+ python scripts/download_import_cldr.py
clean-cldr:
- @rm -f babel/locale-data/*.dat
- @rm -f babel/global.dat
+ rm -f babel/locale-data/*.dat
+ rm -f babel/global.dat
clean-pyc:
- @find . -name '*.pyc' -exec rm {} \;
- @find . -name '__pycache__' -type d | xargs rm -rf
+ find . -name '*.pyc' -exec rm {} \;
+ find . -name '__pycache__' -type d | xargs rm -rf
develop:
- @pip install --editable .
+ pip install --editable .
tox-test: import-cldr
- @tox
+ tox
upload-docs:
$(MAKE) -C docs html dirhtml latex
diff --git a/tox.ini b/tox.ini
index 5cd0a6e..aa93a27 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,9 +11,12 @@ deps =
backports.zoneinfo;python_version<"3.9"
tzdata;sys_platform == 'win32'
whitelist_externals = make
-commands = make clean-cldr test-cov
+commands = make clean-cldr test
+setenv =
+ PYTEST_FLAGS=--cov=babel --cov-report=xml:{env:COVERAGE_XML_PATH:.coverage_cache}/coverage.{envname}.xml
passenv =
BABEL_*
+ PYTEST_*
PYTHON_*
[gh-actions]