Skip to content

Commit 7e95f0c

Browse files
committed
cache pip dependencies
1 parent fb83b23 commit 7e95f0c

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ jobs:
2121
with:
2222
python-version: "3.11"
2323

24+
- name: Cache pip dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
2432
- name: Install dependencies
2533
run: |
2634
python -m pip install --upgrade pip
@@ -77,6 +85,14 @@ jobs:
7785
with:
7886
python-version: ${{ matrix.python-version }}
7987

88+
- name: Cache pip dependencies
89+
uses: actions/cache@v3
90+
with:
91+
path: ~/.cache/pip
92+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
93+
restore-keys: |
94+
${{ runner.os }}-pip-
95+
8096
- name: Install dependencies
8197
run: |
8298
python -m pip install --upgrade pip
@@ -121,6 +137,14 @@ jobs:
121137
with:
122138
python-version: "3.11"
123139

140+
- name: Cache pip dependencies
141+
uses: actions/cache@v3
142+
with:
143+
path: ~/.cache/pip
144+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
145+
restore-keys: |
146+
${{ runner.os }}-pip-
147+
124148
- name: Install dependencies
125149
run: |
126150
python -m pip install --upgrade pip

src/rattlesnake/cicd/report_pytest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ def get_report_html(
105105

106106
# Programmatically construct the full report URL
107107
try:
108-
owner, repo_name = github_repo.split('/')
109-
full_report_url = f"https://{owner}.github.io/{repo_name}/reports/coverage/htmlcov/index.html"
108+
owner, repo_name = github_repo.split("/")
109+
full_report_url = (
110+
f"https://{owner}.github.io/{repo_name}/reports/coverage/htmlcov/index.html"
111+
)
110112
except ValueError:
111113
# Fallback or default URL in case the repo format is unexpected
112114
full_report_url = "#"
@@ -157,7 +159,7 @@ def get_report_html(
157159
<body>
158160
<div class="container">
159161
<div class="header">
160-
<h1>Pytest Report</h1>
162+
<h1>Pytest Coverage Report</h1>
161163
<div class="score">Coverage: {coverage_metric.coverage:.2f}%</div>
162164
<div class="metadata">
163165
<div><strong>Lines Covered:</strong> {coverage_metric.lines_covered}</div>

0 commit comments

Comments
 (0)