Skip to content
Open
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
18 changes: 12 additions & 6 deletions nix/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@
) profiles
) toolchains;

checks = testChecks // {
build = toolchains.nightly.buildPackage (checkArgs // { cargoArtifacts = cargoArtifactsRelease; });

coverage = toolchains.nightly.mkCargoDerivation (
mkCoverage =
suffix: features:
toolchains.nightly.mkCargoDerivation (
checkArgs
// {
cargoArtifacts = cargoArtifactsDev;
pnameSuffix = "-coverage";
pnameSuffix = "-coverage${suffix}";
nativeBuildInputs = [ pkgs.cargo-llvm-cov ];
buildPhaseCargoCommand = ''
mkdir -p $out
cargo llvm-cov --all-features --lcov --output-path $out/coverage.lcov || {
cargo llvm-cov --no-default-features --features ${features} --lcov --output-path $out/coverage.lcov || {
# no coverage data when there are no tests yet
if [ ! -s $out/coverage.lcov ]; then
echo "no coverage data (no tests), skipping assertion"
Expand All @@ -71,6 +70,13 @@
}
);

checks = testChecks // {
build = toolchains.nightly.buildPackage (commonArgs // { cargoArtifacts = cargoArtifactsRelease; });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed from checkArgs to commonArgs. Is that intentional?


coverage = mkCoverage "" "unit-tests,prop-tests";
coverage-no-unit-tests = mkCoverage "-no-unit-tests" "prop-tests";
coverage-no-prop-tests = mkCoverage "-no-prop-tests" "unit-tests";

clippy = toolchains.nightly.cargoClippy (
checkArgs
// {
Expand Down
Loading