Use poetry and set $TOP env in trial & coverage jobs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2 files changed, 11 insertions, 7 deletions
diff --git a/.coveragerc b/.coveragerc
index 18b34693e7..11f2ec8387 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,8 +1,8 @@
[run]
branch = True
parallel = True
-include=synapse/*
-data_file = .coverage
+include=$TOP/synapse/*
+data_file = $TOP/.coverage
[report]
precision = 2
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a5343e5b71..2d0ee90da3 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -57,6 +57,8 @@ jobs:
if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail
needs: linting-done
runs-on: ubuntu-latest
+ env:
+ TOP: ${{ github.workspace }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
@@ -94,12 +96,12 @@ jobs:
python-version: ${{ matrix.python-version }}
extras: ${{ matrix.extras }}
- name: Install Coverage.py
- run: pip install coverage
+ run: poetry add coverage
- name: Await PostgreSQL
if: ${{ matrix.postgres-version }}
timeout-minutes: 2
run: until pg_isready -h localhost; do sleep 1; done
- - run: coverage run --branch --parallel-mode $(which trial) tests
+ - run: poetry run coverage run --branch --parallel-mode -m twisted.trial --jobs 2 tests
env:
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
SYNAPSE_POSTGRES_HOST: localhost
@@ -372,17 +374,19 @@ jobs:
coverage:
needs: trial
runs-on: ubuntu-latest
+ env:
+ TOP: ${{ github.workspace }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: .
- name: Install Coverage.py
- run: pip install coverage
+ run: poetry add coverage
- name: Combine coverage reports
- run: coverage combine
+ run: poetry run coverage combine
- name: Write coverage to XML
- run: coverage xml -i -o coverage/coverage.xml
+ run: poetry run coverage xml -i -o coverage/coverage.xml
- name: Upload combined coverage
uses: actions/upload-artifact@v3
with:
|