@@ -26,14 +26,51 @@ jobs:
2626 architecture : x64
2727 cache : ' pip'
2828
29- - name : Install Poetry manager
29+ - name : Install Poetry (Windows)
30+ if : runner.os == 'Windows'
31+ run : |
32+ (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
33+ echo "$HOME\AppData\Roaming\Python\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
34+
35+ - name : Install Poetry (Unix)
36+ if : runner.os != 'Windows'
3037 run : pip install --upgrade poetry
3138
3239 - name : Install Dependencies
3340 run : poetry install
3441
35- - name : Test with pytest
42+ - name : Test with coverage
43+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
3644 run : |
37- poetry run pytest --cov=transloadit tests
45+ poetry run pytest --cov=transloadit \
46+ --cov-report=xml \
47+ --cov-report=json \
48+ --cov-report=html \
49+ --cov-report=term-missing \
50+ --cov-fail-under=65 \
51+ tests
3852 env :
3953 TEST_NODE_PARITY : 1
54+
55+ - name : Test without coverage
56+ if : matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12'
57+ run : poetry run pytest tests
58+
59+ - name : Upload coverage reports
60+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
61+ uses : codecov/codecov-action@v4
62+ with :
63+ token : ${{ secrets.CODECOV_TOKEN }}
64+ files : ./coverage.xml
65+ flags : unittests
66+ name : python-sdk
67+ fail_ci_if_error : true
68+
69+ - name : Upload coverage artifacts
70+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : coverage-reports
74+ path : |
75+ coverage.json
76+ htmlcov/
0 commit comments