Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[run]
branch = True
relative_files = True
source =
cryptography
tests/

[paths]
source =
src/cryptography
.tox/*/lib*/python*/site-packages/cryptography
.tox\*\Lib\site-packages\cryptography
.tox/pypy/site-packages/cryptography
*.tox/*/lib*/python*/site-packages/cryptography
*.tox\*\Lib\site-packages\cryptography
*.tox/pypy/site-packages/cryptography
tests =
tests/
*tests\

[report]
exclude_lines =
Expand Down
15 changes: 9 additions & 6 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ runs:

steps:
- run: |
PATH="/venv/bin:${PATH}"
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash

bash codecov.sh -n "${{ inputs.name }}"
COVERAGE_UUID=$(python3 -c "import uuid; print(uuid.uuid4())")
echo "::set-output name=COVERAGE_UUID::${COVERAGE_UUID}"
mv .coverage .coverage.${COVERAGE_UUID}
id: coverage-uuid
shell: bash
- uses: actions/[email protected]
with:
name: coverage-${{ steps.coverage-uuid.outputs.COVERAGE_UUID }}
path: ".coverage.*"
if-no-files-found: ignore
37 changes: 34 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ jobs:
sed -E -i 's/SF:src\/(.*)/SF:src\/rust\/src\/\1/g' ../../pytest-rust-cov.lcov
sed -E -i 's/SF:src\/(.*)/SF:src\/rust\/src\/\1/g' ../../cargo-test-rust-cov.lcov

# We use codecov solely for rust coverage now, not Python
- run: |
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash || \
curl -o codecov.sh -f https://codecov.io/bash
bash codecov.sh -n "Rust Coverage" -f '*.lcov' -X coveragepy

- uses: ./.github/actions/upload-coverage
with:
name: "Rust Coverage"
Expand Down Expand Up @@ -575,6 +582,30 @@ jobs:
needs: [linux, linux-distros, linux-rust, linux-rust-coverage, macos, windows, linux-downstream]
if: ${{ always() }}
steps:
- run: echo "😢"; exit 1
if: ${{ needs.linux.result != 'success' || needs.linux-distros.result != 'success' || needs.linux-rust.result != 'success' || needs.linux-rust-coverage.result != 'success' || needs.macos.result != 'success' || needs.windows.result != 'success' || needs.linux-downstream.result != 'success' }}
- run: echo "🎉"
- uses: actions/[email protected]
timeout-minutes: 3
with:
persist-credentials: false
- run: echo "😢"; exit 1
if: ${{ needs.linux.result != 'success' || needs.linux-distros.result != 'success' || needs.linux-rust.result != 'success' || needs.linux-rust-coverage.result != 'success' || needs.macos.result != 'success' || needs.windows.result != 'success' || needs.linux-downstream.result != 'success' }}
- run: echo "🎉"
- name: Setup python
uses: actions/[email protected]
with:
python-version: '3.10'
- run: pip install coverage
- name: Download coverage data
uses: actions/[email protected]
- run: mv **/.coverage* .
- name: Combine coverage and fail if it's <100%.
run: |
python -m coverage combine
python -m coverage html
python -m coverage report --fail-under=100
- name: Upload HTML report.
uses: actions/[email protected]
with:
name: _html-report
path: htmlcov
if-no-files-found: ignore
if: ${{ always() }}