Skip to content

Commit 47be748

Browse files
ci/coverage: Parse generated JSON instead
1 parent 325b653 commit 47be748

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install system dependencies and setup D-Bus
4141
run: |
4242
sudo apt-get update
43-
sudo apt-get install -y libssl-dev pkg-config gnome-keyring dbus-x11
43+
sudo apt-get install -y libssl-dev pkg-config gnome-keyring dbus-x11 jq
4444
4545
# Start D-Bus session
4646
mkdir -p ~/.local/share/keyrings
@@ -77,7 +77,7 @@ jobs:
7777
--ignore-panics \
7878
--out Lcov \
7979
--output-dir coverage-raw
80-
mv coverage-raw/lcov.info coverage-raw/openssl-async-std.info
80+
mv coverage-raw/lcov.info coverage-raw/openssl-tokio.info
8181
8282
- name: Install grcov for merging coverage
8383
uses: taiki-e/install-action@v2
@@ -103,8 +103,8 @@ jobs:
103103
--ignore "**/examples/*" \
104104
--ignore "**/target/*"
105105
106-
# Extract coverage percentage from the HTML index
107-
CURRENT_COVERAGE=$(grep -oP 'Coverage: \K[0-9]+\.[0-9]+' site/coverage/html/index.html | head -1 || echo "0.00")
106+
# Extract coverage percentage from the generated JSON file
107+
CURRENT_COVERAGE=$(jq -r '.message' site/coverage/html/coverage.json | sed 's/%//')
108108
echo "CURRENT_COVERAGE=$CURRENT_COVERAGE" >> $GITHUB_ENV
109109
echo "Combined coverage: $CURRENT_COVERAGE%"
110110

0 commit comments

Comments
 (0)