Fix CI to check that generation script has run (#145)

… based on the discussion in #138

CI wasn't checking that the `./scripts/generate.sh` script had been
run, which this change fixes
This commit is contained in:
Gabriel Gonzalez 2020-09-11 18:11:01 -07:00 committed by GitHub
parent ad3369f9f9
commit efb745854a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 6 deletions

View File

@ -88,7 +88,7 @@ let
in in
''echo './${inputFile} ./${outputFile}' ''echo './${inputFile} ./${outputFile}'
${pkgsNew.dhall-json}/bin/dhall-to-yaml --file $out/${inputFile} > $out/${outputFile} ${pkgsNew.dhall-json}/bin/dhall-to-yaml --file $out/${inputFile} > $out/${outputFile}
''; '';
in in
pkgsNew.runCommand "package-${drv.name}" { XDG_CACHE_HOME="."; } '' pkgsNew.runCommand "package-${drv.name}" { XDG_CACHE_HOME="."; } ''
@ -106,15 +106,40 @@ let
outputFile = "README.md"; outputFile = "README.md";
in in
pkgsNew.lib.optionalString (version == preferredVersion) if (version == preferredVersion)
''echo './${inputFile} ./${outputFile}' then
${pkgsNew.dhall}/bin/dhall text --file $out/${inputFile} | ${pkgsNew.gnused}/bin/sed 's_\.\./package.dhall_https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/master/package.dhall_g' > $out/${outputFile} ''echo './${inputFile} ./${outputFile}'
''
${pkgsNew.dhall}/bin/dhall text --file $out/${inputFile} | ${pkgsNew.gnused}/bin/sed 's_\.\./package.dhall_https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/master/package.dhall_g' > $out/${outputFile}
''
else
''
${pkgsNew.coreutils}/bin/rm --recursive $out/examples
''
} }
${pkgsNew.coreutils}/bin/rm --recursive $out/docs
''; '';
dhall-kubernetes = pkgsNew.callPackage ./dhall-kubernetes.nix {}; dhall-kubernetes = pkgsNew.callPackage ./dhall-kubernetes.nix {};
dhall-kubernetes-tests =
let
process = version: derivation: {
name = "${version}-test";
value =
pkgsNew.runCommand "test-dhall-kubernetes-${version}" {} ''
${pkgsNew.rsync}/bin/rsync --archive ${derivation}/ ./${version}.expected
${pkgsNew.rsync}/bin/rsync --archive ${../. + "/${version}"}/ ./${version}.actual
${pkgsNew.diffutils}/bin/diff --recursive ./${version}.{actual,expected}
touch $out
'';
};
in
pkgsNew.lib.mapAttrs' process pkgsNew.dhall-kubernetes;
haskellPackages = pkgsOld.haskellPackages.override (old: { haskellPackages = pkgsOld.haskellPackages.override (old: {
overrides = overrides =
let let

View File

@ -12,7 +12,9 @@ let
# master in). # master in).
rev = pkgs.runCommand "rev" {} ''echo "${src.rev}" > $out''; rev = pkgs.runCommand "rev" {} ''echo "${src.rev}" > $out'';
} // builtins.removeAttrs pkgs.dhall-kubernetes } // builtins.removeAttrs pkgs.dhall-kubernetes
[ "override" "overrideDerivation" ]; [ "override" "overrideDerivation" ]
// builtins.removeAttrs pkgs.dhall-kubernetes-tests
[ "override-test" "overrideDerivation-test" ];
dhall-kubernetes = pkgs.releaseTools.aggregate { dhall-kubernetes = pkgs.releaseTools.aggregate {
name = "dhall-kubernetes-aggregate"; name = "dhall-kubernetes-aggregate";