Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #434 from target/ci-lint-check-cargo-nix-diff
Browse files Browse the repository at this point in the history
ci_lint: ensure generated files are checked in correctly
  • Loading branch information
Profpatsch authored Jun 29, 2020
2 parents 7732168 + 83e9aa8 commit 8ea8972
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ pkgs.mkShell (
./nix/update-carnix.sh
carnixupdate=$?
git diff --quiet -- Cargo.nix
carnixdiff=$?
carnixupdate=$((carnixupdate + carnixdiff))
cargo fmt -- --check
cargofmtexit=$?
Expand All @@ -110,6 +113,7 @@ pkgs.mkShell (
set +x
echo "./nix/fmt.sh --check: $nix_fmt"
echo "carnix update: $carnixupdates"
echo "Cargo.nix changed: $carnixdiff"
echo "cargo fmt: $cargofmtexit"
echo "cargo clippy: $cargoclippyexit"
Expand All @@ -130,11 +134,15 @@ pkgs.mkShell (
cargo test
cargotestexit=$?
git diff --quiet -- src/
gendiff=$?
set +x
echo "script tests: $scripttests"
echo "generated files changed: $gendiff"
echo "cargo test: $cargotestexit"
sum=$((scripttest + cargotestexit))
sum=$((scripttest + cargotestexit + gendiff))
if [ "$sum" -gt 0 ]; then
return 1
fi
Expand Down

0 comments on commit 8ea8972

Please sign in to comment.