Fix the CI...

This commit is contained in:
Antoine Eiche 2022-12-15 08:49:39 +01:00
parent 3b0c0eebe4
commit da9259ff63
3 changed files with 14 additions and 2 deletions

View File

@ -10,4 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v15
- run: nix run -L '.#tests.all'
- run: |
# See https://github.com/containers/podman/issues/5114#issuecomment-779406347
rm -rf ~/.local/share/containers/
nix run -L '.#tests.all'

View File

@ -17,6 +17,9 @@ nix2container.buildImage {
# A user is required by nix
# https://github.com/NixOS/nix/blob/9348f9291e5d9e4ba3c4347ea1b235640f54fd79/src/libutil/util.cc#L478
"USER=nobody"
# When running in podman on the GitHub CI, Nix fails to find the
# user home dir for an unkonwn reason...
"HOME=/"
];
};
# This is to check store path in nested layers are also added to the

View File

@ -12,6 +12,9 @@ let
ret=$?
if [ $ret -ne 0 ];
then
echo "image list"
${pkgs.podman}/bin/podman image list
echo ""
echo "Actual output:"
${pkgs.podman}/bin/podman run ${image.imageName}:${image.imageTag} ${command}
echo
@ -133,7 +136,10 @@ let
};
};
all =
let scripts = pkgs.lib.concatMapStringsSep "\n" (s: "${s}/bin/test-script") (builtins.attrValues tests);
let scripts =
pkgs.lib.concatStringsSep
"\n"
(pkgs.lib.mapAttrsToList (n: v: "echo Running test '${n}'\n${v}/bin/test-script") tests);
in pkgs.writeScriptBin "all-test-scripts" ''
set -e
${scripts}