From d974cf4e67325a48d162d3be9abb139fa7e7e14f Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Wed, 8 May 2024 10:15:35 -0700 Subject: [PATCH] Update CI to run tests in parallel This also required reworking how the coverage reports are generated and uploaded as artifacts. --- .github/workflows/ci.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a7e40a8..677041a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: - python-version: 3.8 # Possible future version. backend: "mariadb" mariadb-version: "10.11" + name: "py${{ matrix.python-version }}-${{ matrix.backend }}-${{ matrix.mariadb-version }}" services: @@ -77,13 +78,18 @@ jobs: run: python manage.py collectstatic --noinput --settings=config.settings.test - name: Run tests - run: coverage run -p -m pytest + run: | + pytest --cov=gregor_django -n auto + mv .coverage .coverage-${{ strategy.job-index }} + + - name: List files for debugging purposes + run: ls -lhta - name: Upload coverage data uses: actions/upload-artifact@v4 with: name: coverage-data-${{ strategy.job-index }} - path: .coverage.* + path: .coverage-${{ strategy.job-index }} coverage: needs: @@ -110,13 +116,14 @@ jobs: - name: Merge coverage files run: | - mv ./artifacts/coverage-data*/.coverage* . + python -m coverage combine ./artifacts/coverage-data*/.coverage-* + python -m coverage xml ls -la .coverage* - - name: Combine coverage data + - name: Report coverage run: | - python -m coverage combine - python -m coverage xml + python -m coverage report + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: