Unverified Commit 3304685a authored by Matt Sturgeon's avatar Matt Sturgeon Committed by GitHub
Browse files

ci/parse.nix: Fail on warning (#511836)

parents aeea0481 2454755d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -184,9 +184,10 @@ rec {
    nix = pkgs.nixVersions.latest;
  };
  parse = pkgs.lib.recurseIntoAttrs {
    latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; };
    lix = pkgs.callPackage ./parse.nix { nix = pkgs.lix; };
    nix_latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; };
    nix_2_28 = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.nix_2_28; };
    lix = pkgs.callPackage ./parse.nix { nix = pkgs.lix; };
    lix_latest = pkgs.callPackage ./parse.nix { nix = pkgs.lixPackageSets.latest.lix; };
  };
  shell = import ../shell.nix { inherit nixpkgs system; };
  tarball = import ../pkgs/top-level/make-tarball.nix {
+8 −1
Original line number Diff line number Diff line
@@ -28,7 +28,14 @@ runCommand "nix-parse-${nix.name}"
    # the other CI jobs will report in more detail. This job is about checking parsing
    # across different implementations / versions, not about providing the best DX.
    # Returning all parse errors requires significantly more resources.
    find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse >/dev/null

    find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse 2>&1 >/dev/null | {
      # Also fail on (deprecation) warnings printed to stderr.
      if grep "warning"; then
        echo "Failing due to warnings in stderr" >&2
        exit 1
      fi
    }

    touch $out
  ''