@@ -73,22 +73,40 @@ jobs:
7373 if : ${{ contains(matrix.python-version, 'pypy') && runner.os == 'Linux' }}
7474 run : sudo apt install libpq5
7575 - name : Run test
76+ id : run_serial_tests
7677 uses : fizyk/actions-reuse/.github/actions/pipenv-run@v4.4.7
7778 with :
78- command : pytest -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --cov-report=xml --basetemp="${{ runner.temp }}/pytest-basetemp"
79+ command : python -m coverage run --data-file=.coverage.serial -m pytest -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
80+ env : ' {"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.serial"}'
81+ - name : Combine and export serial coverage
82+ if : ${{ always() && (steps.run_serial_tests.conclusion == 'success' || steps.run_serial_tests.conclusion == 'failure') }}
83+ uses : fizyk/actions-reuse/.github/actions/coverage-combine-export@v4.4.7
84+ with :
85+ data-file : .coverage.serial
86+ output-file : coverage-serial.xml
7987 - name : Run xdist test
88+ id : run_xdist_tests
8089 uses : fizyk/actions-reuse/.github/actions/pipenv-run@v4.4.7
8190 with :
82- command : pytest -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --cov-report=xml:coverage-xdist.xml --basetemp="${{ runner.temp }}/pytest-basetemp"
91+ command : python -m coverage run --data-file=.coverage.xdist -m pytest -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
92+ env : ' {"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.xdist"}'
93+ - name : Combine and export xdist coverage
94+ if : ${{ always() && (steps.run_xdist_tests.conclusion == 'success' || steps.run_xdist_tests.conclusion == 'failure') }}
95+ uses : fizyk/actions-reuse/.github/actions/coverage-combine-export@v4.4.7
96+ with :
97+ data-file : .coverage.xdist
98+ output-file : coverage-xdist.xml
8399 - uses : actions/upload-artifact@v7
84100 if : failure()
85101 with :
86102 name : postgresql-${{ matrix.python-version }}-${{ inputs.postgresql }}
87103 path : ${{ runner.temp }}/pytest-basetemp/**
88104 - name : Upload coverage to Codecov
105+ if : always()
89106 uses : codecov/codecov-action@v6.0.0
90107 with :
91108 token : ${{ secrets.codecov_token }}
92109 flags : unittests
93110 env_vars : OS,PYTHON
94111 fail_ci_if_error : false
112+ files : coverage-serial.xml,coverage-xdist.xml
0 commit comments