Coverage files not getting created in CI

Viewed 61

This is my workflow (shortened):

on: [push, pull_request]

jobs:
  tests:
    name: Run tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v3
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install tox tox-gh-actions
      - name: Test with tox
        run: tox
      - name: Upload coverage artifact
        uses: actions/upload-artifact@v3
        with:
          name: coverage-data
          path: .coverage.*
          if-no-files-found: error

This is tox.ini (shortened):

[tox]
minversion = 3.24.5
envlist = py{37,38,39,310}
isolated_build = true

[testenv]
deps =
  {[testenv:coverage]deps}
commands =
  {[testenv:coverage]commands}

[testenv:coverage]
setenv =
  PYTHONPATH = {toxinidir}
deps =
  coverage[toml]
  pytest
commands =
  coverage run -m pytest

The .coverage files get created locally on my Windows PC, but do not on Github Actions CI.

You can find the full files here. SO wasn't allowing me to put it all here.

0 Answers
Related