Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport mitmproxy & codecov changes #7158

Merged
merged 2 commits into from Apr 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions .coveragerc
@@ -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
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/upload-artifact@v3.0.0
with:
name: coverage-${{ steps.coverage-uuid.outputs.COVERAGE_UUID }}
path: ".coverage.*"
if-no-files-found: ignore
39 changes: 35 additions & 4 deletions .github/workflows/ci.yml
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 @@ -507,7 +514,7 @@ jobs:
RUST:
- stable
PYTHON:
- 3.8
- 3.9
name: "Downstream tests for ${{ matrix.DOWNSTREAM }}"
timeout-minutes: 15
steps:
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/checkout@v2.4.0
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/setup-python@v3.1.2
with:
python-version: '3.10'
- run: pip install coverage
- name: Download coverage data
uses: actions/download-artifact@v3.0.0
- 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/upload-artifact@v3.0.0
with:
name: _html-report
path: htmlcov
if-no-files-found: ignore
if: ${{ always() }}