Skip to content

Commit

Permalink
Merge pull request #833 from python-babel/codecov
Browse files Browse the repository at this point in the history
Fix Codecov
  • Loading branch information
akx committed Jan 27, 2022
2 parents 8bbaa65 + a3639f6 commit d3cea2a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -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:
Expand All @@ -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 }}
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -8,6 +8,7 @@
*~
.*cache
.DS_Store
.coverage
.idea
.tox
/venv*
Expand All @@ -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
29 changes: 13 additions & 16 deletions 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
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Expand Up @@ -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]
Expand Down

0 comments on commit d3cea2a

Please sign in to comment.