Skip to content

Commit

Permalink
[CI] Switch to source-based code coverage for rust
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jan 7, 2025
1 parent ebd72a4 commit 60e6d05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
12 changes: 1 addition & 11 deletions CI/decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,9 @@ def main():
coverage_mounts = [
{f"file:cov-{task.id}.zip": task} for task in TestTask.coverage
]
task = Build.by_name("linux.coverage")
coverage_mounts.append(
{
"file:gcno-build.zip": {
"artifact": task.artifacts[1],
"taskId": task.id,
}
}
)

merge_coverage.extend(
[
"grcov -s repo -t lcov -o repo/coverage.lcov gcno-build.zip "
"grcov -s repo -t lcov -o repo/coverage.lcov "
+ " ".join(f"cov-{task.id}.zip" for task in TestTask.coverage),
]
)
Expand Down
11 changes: 2 additions & 9 deletions CI/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ def prefix(p, s):
hash = None
head = None
desc_variant = variant
extra_commands = []
environ = {}
cargo_flags = ["-vv", "--release"]
cargo_features = ["self-update", "gitdev", "xz2/static", "bzip2/static"]
Expand Down Expand Up @@ -430,14 +429,9 @@ def prefix(p, s):
"-fPIC",
]
)
artifacts += ["coverage.zip"]
extra_commands = [
"(cd repo && zip $ARTIFACTS/coverage.zip"
' $(find . -name "*.gcno" -not -name "build_script*"))',
]
environ["RUSTFLAGS"] = " ".join(
[
"-Zprofile",
"-Cinstrument-coverage",
"-Ccodegen-units=1",
"-Cinline-threshold=0",
]
Expand Down Expand Up @@ -543,8 +537,7 @@ def prefix(p, s):
"release" if "--release" in cargo_flags else "debug",
artifact,
),
]
+ extra_commands,
],
artifacts=artifacts,
env=environ,
)
Expand Down

0 comments on commit 60e6d05

Please sign in to comment.