paprika
paprika copied to clipboard
Github Actions: Use poetry + Coverage without breaking codecov
The right way to set up a poetry CI env is shown in #14 in .github/workflows/unittest.yml
.
The below was tried for .github/workflows/unittest.yml
but does not work due to Codecov failures.
name: Test and collect coverage
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: "3.9"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.4
- name: Install dependencies
run: poetry install
- name: Collect coverage
run: poetry run coverage run -m unittest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
with:
verbose: true
The codecov step apparently passes, but the codecov website showed that it failed without much reason.
My guess is that the previous workflow.yml file has a faulty .env in which the env entry gives 3.9 for python, but the Setup Python step uses a 3.7 version instead. This makes the env mismatch problem persist, but that doesn't make sense to be honest.
The difference in running the test poetry run coverage run -m unittest
vs. coverage run -m unittest
may be an issue as well, but running test -f .coverage
for the former does not fail.
Closed by #14
Not fixed